Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sprite Movement help

Author
Message
Hashmark
13
Years of Service
User Offline
Joined: 6th Jul 2011
Location:
Posted: 20th Jul 2011 06:36
Looking to get this sprite to "move slowly back" to its starting position when dbSpacebar is not pressed. i can make it zip back by giving it the ufoX and ufoY coordinates but i'd like for it to move slowly back down the Y axis and stop at ufo x and ufo Y




Ive gone back through the chapters and i cannot find anything on this, i am sure i need to use an operator or two somewhere and which kind i just can't figure out ty for help

Thank you for helping!
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 20th Jul 2011 10:45
For example:



It will sink with the same speed as it rises. If that's too fast, it's possible to calculate coordinates in floating point, so that you can define movement in less than one pixel units and round to the nearest integer only when the sprite is displayed.

By the way, what exactly did you want to do with this line?



If you calculate both x and y in this function, I would expect to see rather:



The comma is a valid operator in C++ and your statement compiles, but in this case it doesn't have much meaning to use it like that. On this page you will find the description of the comma operator (about the middle of the page).

http://www.cplusplus.com/doc/tutorial/operators/

Login to post a reply

Server time is: 2024-11-19 09:27:04
Your offset time is: 2024-11-19 09:27:04