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.

Newcomers DBPro Corner / 2D animation problem Help Needed!

Author
Message
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 30th Jul 2010 08:58
how can I make image number 3,4 and then 5,6 an animation for sprite 1 so I can player it when he walks?
this is only how far I got


I want coke, not Pepsi!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 30th Jul 2010 16:36
You'd want to simply alternate the sprite images as part of your movement code.

Example:


CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 30th Jul 2010 19:53 Edited at: 31st Jul 2010 08:00
ok will try
edit: the sprite won't show at all.
edit: forgot .png at end of load, but it now has an error that it can't load that sprite.


Also if the player were to equip something could you make a sprite (sword for example) and make it a different sprite then load it in your game and make it look like your guy is holding it and then when you press spacebar he plays the animation using something like (player being sprite 1 and sword being sprite 2. animation 2 is player hitting with that sword. pretend there are also 10 weapons, each with there animation equal to there number)


I want coke, not Pepsi!
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 31st Jul 2010 19:13 Edited at: 1st Aug 2010 01:48
Bump.
Can anybody help me?
61 views. 1 Post from other

I want coke, not Pepsi!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 1st Aug 2010 10:41
Quote: "edit: forgot .png at end of load, but it now has an error that it can't load that sprite."


Can't load the image you mean? If you drop the "C:\Users\Dollie\Desktop\DB\GameFolders\2dGame" part of each loaded image it would still work if 2dGame is your main programs directory. I would put all the player graphics in the MainPlayer directory and not have directories for each direction inside MainPlayer.



Quote: "Also if the player were to equip something could you make a sprite "


Yes, but you should focus on one problem at a time first. Zip up and upload those images so we can help you easier.

Quote: "Bump.
Can anybody help me?
61 views. 1 Post from other"


Sometimes it takes a while... don't get frustrated if you don't get replies right away.

CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 2nd Aug 2010 03:26
I tried in the same folder and it still says it can't load it, does DBP have a problem with png?

I want coke, not Pepsi!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Aug 2010 09:28
It shouldn't .pngs are the best to use with Darkbasic. Zip up the directory the way you have it right now and attach it to your next message.

=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 2nd Aug 2010 15:21
It might be worth checking that you have made a project file, and aren't just trying to run a .dba on its own.

The .dbpro file contains details of what folder the exe is to be compiled into/run from.

Without a project file, your code will be compiled and run from the temp folder, which isn't where you media is.

Although this shouldn't have mattered with those absolute paths you were using before.

Failing that, I'm with Grog in saying zip the whole folder up and post it here so we can have a better look at whats going wrong.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 2nd Aug 2010 16:02
Did you get an image to actually appear on a sprite?
Also, I noticed you don't have extensions on your files:

Did you mean something like this:

You CAN alternate the images by setting sprite 1,200,200,x. Where x is the variable holding the image number you change.
OR you can string the images off-screen and use a GET IMAGE to make a single image. Then you can MAKE ANIMATED SPRITE (look at the help... I'm not at my home pc now). The MAKE ANIMATED SPRITE gives you options for how many rows and collumns the image has. The rows and collumns represent the distinct images within the bigger image you made with GET IMAGE. You can save the image also with SAVE IMAGE.

The fastest code is the code never written.
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 2nd Aug 2010 23:38
Never mind i'm doing other stuff right now, i'll figure it out later, thanks guys!

I want coke, not Pepsi!

Login to post a reply

Server time is: 2024-11-16 15:37:22
Your offset time is: 2024-11-16 15:37:22