Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrPenguin9

macrumors member
Original poster
Aug 1, 2008
59
0
Hi, I am new to programing for the iPhone(I bought my mac yesterday). I want to make a simple game where there is a button "Right" and a button "Left", and when you press the button the sprite moves. And when you let go of the button, the sprite stops moving. And I can't figure out how to make the sprite move.

Thanks so much
 
Have you looked at Apple's sample code in the dev center? There seem to be several animation app examples for you to study.


.

Yes I have gone through it and I found "CGAffineTransformMakeTranslation" but it doesn't tell me how to use it.:(
 
What do you think I'm trying to do? Get some common sense.

If you've never programmed anything before, the best way to start learning is not to come in and specifically ask how to achieve effect X. You need to learn some fundamentals so you don't have to keep asking when you want to do Y or Z.

What you are trying to do is very simple and should not be difficult to figure out by reading through Apple's documentation and doing some objective-C tutorials. It may be painful at first but in the long run you'll be better off.
 
If you have never programmed in objective C before I'd suggest beginning with something easier, for example simple hello world with one button etc. Knowing the syntax, delegation and other fundamentals will really help you to improve fast, no point in creating more difficult app on the very beginning.
 
If you have never programmed in objective C before I'd suggest beginning with something easier, for example simple hello world with one button etc. Knowing the syntax, delegation and other fundamentals will really help you to improve fast, no point in creating more difficult app on the very beginning.

>_> I have done a hello word tutorial and a couple of other. But I can't find one about movement.
 
>_> I have done a hello word tutorial and a couple of other. But I can't find one about movement.

That is because movement is slightly more advanced.

You have to use the CGAffineTransformMakeTranslation and apply it to your object's transform property.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.