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 / Help with dbCreateAnimatedSprite( [...] );

Author
Message
SideStep
6
Years of Service
User Offline
Joined: 28th May 2013
Location:
Posted: 28th May 2013 18:12
Hello, I am having this really weird problem with the game I'm working on. The problem is that dbCreateAnimatedSprite( [...] ); doesn't act the way it should, it loads the image, but doesn't split it into frame even though the parameters I specify are correct. The image isn't the problem either, since it loads and animates in one of the tutorials - Hello world! ( the one that has a spinning globe with the words "Hello World!" ). I'd specify the code itself but it's incredibly long and the functions (dbCreateAnimatedSprite & dbPlaySprite) have nothing wrong with them, the properties I specify have no faults. I can't find any help in google, except one forum post that has no fix to this problem... I figured that something is interacting with the dbCreateAnimatedSprite, but I have no idea what... Can you help me?

Thanks.
Timidon
14
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 28th May 2013 20:34
More than likely need some code samples to try and take a look at what the processes is doing.

There are many answers but just one question" ~ Jerilith the Mad
SideStep
6
Years of Service
User Offline
Joined: 28th May 2013
Location:
Posted: 28th May 2013 21:32
It's really long so...

main.cpp


Enemy01.h (where i'm using dbPlaySprite)
s_i
10
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 31st May 2013 20:54
dbCreateAnimatedSprite() works perfectly. Also DarkGDK has tutorial:
C:\Program Files (x86)\The Game Creators\Dark GDK\Tutorials\Dark Invaders
There you can see example of using dbCreateAnimatedSprite() (find in Player.cpp).
SideStep
6
Years of Service
User Offline
Joined: 28th May 2013
Location:
Posted: 31st May 2013 22:37
The thing is, I know it works, i tried the tutorial, i used my images and everything they work without any faults, but in the code I'm using it just doesn't work...
SideStep
6
Years of Service
User Offline
Joined: 28th May 2013
Location:
Posted: 19th Jun 2013 10:20




So no help for me?
It doesn't create a sprite sheet, well it doesn't make frames out of it. When it "Plays Sprite" it just changes through images.
If no one can help, i'll just quit it. So - no loss.
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 20th Jun 2013 02:48
Quote: "When it "Plays Sprite" it just changes through images."

Isn't that exactly what it's supposed to do..?

Anyway, I would suggest you write your own sprite animation system as the built-in one is rather limited and it's easy enough to do yourself, especially using C++ where you can logically wrap the functionality for this into a class.

The basic idea is that an animation is a sequence of images that you change for a certain sprite after a specified amount of time has passed. If you want it to loop you reset to the first frame after reaching the last.
It is also fairly easy to extract sub-images (by reading pixels in a rectangle of a larger image) if you want to read in sprite sheets without having to save them as separate images first. Or, if you want to be fancy about it, you could use the sprite sheet to texture the sprite and then change it's UV-coordinates to change the displayed frame (DGDKs sprites are really textured plains).


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2019-09-22 03:30:12
Your offset time is: 2019-09-22 03:30:12