Hi.
In this topic I'd like to write my methods of solving a particular problem and discuss with you how it could be made more easily and properly.
The first task:
We need to make that if we press ''Space'' sprite moves up to 64 pixels, and then if we press ''Space'' again it returns to the original position (moves down to 64 pixels) and so all the time.
I made it by 3 methods:
1st method.
<img src="http://i45.tinypic.com/10hk4rq.jpg">
2nd method.
<img src="http://i48.tinypic.com/11vp6s3.jpg">
These two methods work but not properly � when I run the application and press ''Space'' the first time nothing happens. But if I press it again � sprite moves and events begin to work .
Question: why it doesn't work the first time?
~~~
3d method.
<img src="http://i45.tinypic.com/c7pk4.jpg">
This method works fine.
Question: is there any way to accomplish the task easier ?