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 / 2d animation

Author
Message
bkbatman
14
Years of Service
User Offline
Joined: 6th Sep 2010
Location:
Posted: 8th Aug 2012 14:08
Hello the I would like to know, how to play another animation
sprite over another. I'm making a "streetfighter game" which I load
the standing animation sprite, and I would like to know how would I
make the standing animation combine with the siting animation sprite.
Like if user press the down key the standing animation sprite would go
to siting. If user let go of the key it will return back to standing.

View My Video

http://tinypic.com/r/ilx1fd/6

the legendary master
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 8th Aug 2012 14:20
If you want to interpolate between frames in 2D, that will be hard.
As for just having different animations I would suggest writing your own system to handle it (the built-in one is way too simple).
What you would do is simply change a sprite's image after a set delta time.


"Why do programmers get Halloween and Christmas mixed up?"
Mister Fuzzy
13
Years of Service
User Offline
Joined: 27th Feb 2011
Location: XNA
Posted: 10th Aug 2012 22:30
Are you saying you want the animation to loop frames A thru B while standing, but loop frames C thru D while crouching? Or are you looking for frame-to-frame image blending?

It's been fun: So long, TGC!
bkbatman
14
Years of Service
User Offline
Joined: 6th Sep 2010
Location:
Posted: 18th Aug 2012 07:28
Well not really loop but to move from 1 frame to another frame if a key is press.
Like for explain look at the ryu sprite standing, I want if user press the down key, I want the standing sprite to move to the siting sprite. Now if user would let go of the down key. The sprite would go back up to ryu standing sprite.
Now please watch this video as you can see the ryu is standing then if a key a pressed he move to another animation how is this done?

http://www.youtube.com/watch?v=NKH7S4rV2yE

the legendary master
Mister Fuzzy
13
Years of Service
User Offline
Joined: 27th Feb 2011
Location: XNA
Posted: 18th Aug 2012 23:49 Edited at: 18th Aug 2012 23:54
Oh, then that's fairly simple. Just use something like:

I'm assuming by now you have some sort of platform movement set up, but if you don't, you should probably focus on that first. Sure, this will work fine if you remove the "IsOnGround" variable, but to properly "crouch," you have to be able to check if the player is on the ground or not (It wouldn't make sense to be able to crouch in mid-air, would it?). And if the player is NOT crouching, then the standard motion control would be available again. The aforementioned code is not the ONLY way to do this (And probably not the best way, either), but this is the kind of logic you'll need to think about as a budding programmer. I can help you write platformer code, but ONLY if you try doing it yourself first. I'm not gonna hold your hand through the entire game design process.

Drink a few coffees, read some design articles, and make yourself a platformer engine. If you fail, I'll be more than happy to help. You can't learn if you have others do the work for you! (A lesson I learned the hard way when I used PAlib years ago...)

EDIT: On reading your first post again, I noticed how you worded that you wanted to play "one animated sprite over another." Are you seperating all of your animations (running, jumping, waling, crouching) into seperate sprite images? Quick fix: Put all of the frames into the same image file (make sure they're evenly spaced!). Then you can simply use dbCreateAnimatedSprite(...) to make the sprite animated. Then you can use dbPlaySprite(...) and dbSetSpriteFrame(...) to change images.

It's been fun: So long, TGC!

Login to post a reply

Server time is: 2024-11-18 21:33:31
Your offset time is: 2024-11-18 21:33:31