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.

2D All the way! / code! movement! help!!!!

Author
Message
Mr Inquisitive
21
Years of Service
User Offline
Joined: 5th Feb 2005
Location: Who Cares?
Posted: 28th Apr 2005 12:34
i used a complicated way to animate my sprite, but it works, and nobody comment on it. i don't get it. my character won't move! any help will be much appreciated.

Thanks in advance

Horus Game Developments
freewebs.com/horusgames
zenassem
23
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 28th Apr 2005 13:03
Since you asked noone to comment on the way the code is written I'll refrain commenting.

====

The reason why your sprite isn't moving is because you don't have any code in the loop to update the sprite position


you use the sprite command in the beginning with charx & chary to set the sprites position

In the loop you update charx and chary but you fail to use them in any command to update the sprites new location. Using show sprite will not take the new values of charx and chary. It will just show the sprite at the last set coordinates

so you need to either use the "sprite" or "paste sprite" commands.

Just note. I believe if you use paste sprite you will lose the ability to use the built in sprite collision commands. Unless that has been fixed since I have been away.

you could also use offset sprite but you need to understand the difference.


Mr Inquisitive
21
Years of Service
User Offline
Joined: 5th Feb 2005
Location: Who Cares?
Posted: 28th Apr 2005 13:26
actually, i could use an easier way to animated it, that would allow me to make it move.

Horus Game Developments
freewebs.com/horusgames
Long Striker
21
Years of Service
User Offline
Joined: 16th Apr 2005
Location:
Posted: 29th Apr 2005 23:15
Im new to programing and im try to make a 2D fighter. but i found away to animated my sprites and move them all around left,right, and jump.
I just have problem with collison dection but you could look at my code here [/href]http://forum.thegamecreators.com/?m=forum_view&t=52814&b=4[href]
and maby find a better way to do somthing your after, feel free to use this code in anyway you want.
Im not saying my code is the best way to do anything but i know it works.



(zenassem you could go back to that form and try to help me with my collison dection if you wanted )
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 30th Apr 2005 03:02
use Roll sprite (if i remember..) to move the sprite + animation...

By the time you finish reading this, you realize you have wasted 5sec. of your life!
click here to return your 5sec.

Login to post a reply

Server time is: 2026-06-12 11:22:02
Your offset time is: 2026-06-12 11:22:02