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.

DarkBASIC Discussion / 2D animation problems

Author
Message
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 12th Nov 2003 03:13
im making a game with 2D animation and i have the animation part down but i cant make the charactor move when you push the upkey.he does move just first thing you push then no more.i tried putting the inc code in the loop but then the charator just disapeared.How can i get it to work?

Here's my code
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 12th Nov 2003 08:01
For starters, get rid of your nested Do...Loops... very messy programming habit, that...

and for moving the sprite, use (in the main loop, not a nested one):

or;


Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 13th Nov 2003 00:24
thanks. i have another question now though.I was wondering how you make it so the charactor doesnt go throught the landscape?Its probably really easy but i cant figure it out. Thanks.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 13th Nov 2003 07:13
Hmm, do you mean in 2D or 3D?
in 3D yu just check if the characters Y position is less than the ground height at the same point on teh X Z coords, and if it is, you position it at the ground height.

For 2D it could be any number of things you need to do...

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 13th Nov 2003 23:19
i mean 2D.
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 13th Nov 2003 23:44
jess you silly guy...

you have to position the spirit infront of the background image....how to do this im not sure...

http://www.freewebs.com/ingamers
load image "sp1.bmp",1
paste???? 2d games = fun....teach me

Login to post a reply

Server time is: 2025-05-21 19:03:29
Your offset time is: 2025-05-21 19:03:29