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 Professional Discussion / Animation and sprites?

Author
Message
WAKS
12
Years of Service
User Offline
Joined: 5th Oct 2013
Location: Oslo, Norway
Posted: 15th Oct 2013 22:05
Hello
I am a beginner in DarkBasic pro and I have started on a simple 2D fighting game project. My problem is that I don't know how to add animation to my sprite. for example if my sprite character move then the move animation start. I also want to know which animation files DarkBasic pro supports, and which files that are the most common/easiest to use. If anyone has a code example that would be nice I have also add a picture of my game if anyone is interesting to see.

Thanks for Help

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 15th Oct 2013 23:47
Take a look to those examples I found in the forum .

I'm not a grumpy grandpa
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 16th Oct 2013 00:22 Edited at: 16th Oct 2013 00:23
With all due respect, it is best to learn from a number of examples; this google search provides 3260 listings based on creating animated sprites in DBPRO.

The help documentation also indicates how to use the Create Animated Sprite command.

Edit: Beat me to it...

WAKS
12
Years of Service
User Offline
Joined: 5th Oct 2013
Location: Oslo, Norway
Posted: 16th Oct 2013 09:51
Thanks guys I will check out your links and examples afterwards today.
WAKS
12
Years of Service
User Offline
Joined: 5th Oct 2013
Location: Oslo, Norway
Posted: 16th Oct 2013 15:01
Hello I have tried out your examples and links, but I have still problems with to get the animation to works perfect. The problem now is then I move my sprite the animation starts, but the hole sprite is not showing up, I also need a code that starts the animation when my character move (for example a running animation). I have also attached a video were you could see my problem. the Animation sprite I am using now is only a test, and it is not that sprite sheet I am going to use. My idea is that when I move my fightersprite (Karate guy), then the animation will start. I have not maked any Karate sprite sheets, therefore I use a test sprite sheet from metal slug.

Thanks for answer
WAKS
12
Years of Service
User Offline
Joined: 5th Oct 2013
Location: Oslo, Norway
Posted: 16th Oct 2013 15:02
Here is also my code and the test sprite sheet

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Oct 2013 15:47
@waks

I have not all images you use in your example, so I can't test your code. Take a look to this new example.

I'm not a grumpy grandpa
WAKS
12
Years of Service
User Offline
Joined: 5th Oct 2013
Location: Oslo, Norway
Posted: 16th Oct 2013 15:56
Thanks, It's works perfect
WAKS
12
Years of Service
User Offline
Joined: 5th Oct 2013
Location: Oslo, Norway
Posted: 16th Oct 2013 16:03
But how can I play the animation when my player move, and how can I mirror the animation, for example; when I go to right the animation sprite points right, and when my sprite go to left the animation sprite points left, and when my player stop then the animation stop?? how could i do that? Since I am a beginner I have not so much experience, therefore I need some help

Thanks for answers
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Oct 2013 16:11
Quote: "But how can I play the animation when my player move"

Have you seen the three examples in the rar file I sent you above ?


Here it goes again

I'm not a grumpy grandpa
WAKS
12
Years of Service
User Offline
Joined: 5th Oct 2013
Location: Oslo, Norway
Posted: 16th Oct 2013 16:17
Thanks, I had completely forgotten the 3 examples you give me above

Login to post a reply

Server time is: 2026-07-07 00:10:11
Your offset time is: 2026-07-07 00:10:11