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 / Create Animated Sprite

Author
Message
jerryd
6
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 24th Mar 2013 05:59
DarkBasic forum,

I have a sprite sheet that has 70 sprites, 10 across by 7 down.
It\'s a .bmp file.

The help file says the \"create animated sprite\" command uses 5
parameters but the example at the bottom of the help page shows
6 parameters. Here\'s the actual example:

create animated sprite 1,\"manwalking.bmp\",1,16,16,1


If I use this example the compiler issues a Syntax Error. If
I remove the first \",1\" after the path it compiles OK.
my actual command:

Create Animated Sprite 1,\"spriteSheet.bmp\",10,7,1

Now when I run the program this code only shows the first sprite.

Play Sprite 1,1,10,100
Play Sprite 1,2,10,100
Play Sprite 1,3,10,100

What am I doing wrong? Probably everything.

jerryd
pcRaider
12
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 24th Mar 2013 08:55
helpfile's example is mistake.
I attach an example.

windowsXp

Attachments

Login to view attachments
jerryd
6
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 24th Mar 2013 17:07
pcRaider,

Thank you very much. I was very frustrated with animation.
Your examples all worked and now I'm about 90% of the way
there.

The only problem I have now is the sprite sheet I have is
was downloaded from the net and I had to put it in a pixel
editor to pick out just the sprites I wanted. Now the
sprites are not separated right. Is there a program that
separates and cleans up downloaded sprite sheets?

jerryd
pcRaider
12
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 25th Mar 2013 02:58
I do not have "sprite sheet separated editor".
I use DBP.
load image, get image, save iamge, paste image, etc,,,
You can make a tool.

windowsXp
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Mar 2013 03:29 Edited at: 25th Mar 2013 03:33
You will be able to extract the animation in DBP regardless.

Quote: "I have a sprite sheet that has 70 sprites, 10 across by 7 down"


Quote: "
create animated sprite 1,\"manwalking.bmp\",1,16,16,1"


You need to set the frames accross to 70, and frames down to 10; instead you've set it to 16 accross and 16 down respectively.

jerryd
6
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 25th Mar 2013 03:56
pcRaider,

I looked on the net for DBP and didn't really find a sprite
editor by that name. Where can I get it?

Jerryd
jerryd
6
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 25th Mar 2013 04:58
Chris Tate,

The 16 X 16 was the example from the DarkBasic help.
My actual command is:
Create Animated Sprite 1,\"spriteSheet.bmp",10,7,1

The problem I have is not all the sprites in the sheet
are symetrically placed and in the last row there are
only 8 instead of 10.

When I cycle through all the sprites sometimes on the
screen there is the current sprite and some remnents
of the previous sprite.

Jerryd
pcRaider
12
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 25th Mar 2013 05:58 Edited at: 25th Mar 2013 06:03
You have ms-paint.
It is included in Windows.
You use a cut, paste.


http://www.youtube.com/results?search_query=how+to+make+sprite

windowsXp
jerryd
6
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 25th Mar 2013 06:23
pcRaider,
Thanks I'll try that.

jerryd
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Mar 2013 20:55
Quote: "When I cycle through all the sprites sometimes on the
screen there is the current sprite and some remnents
of the previous sprite."


Are you willing to show me sprite map?

jerryd
6
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 28th Mar 2013 05:55
Chris,
The sprite map is attached to this post. It's part of one I
got off the net.

jerryd

Attachments

Login to view attachments
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 28th Mar 2013 10:15
It's a bad sprite map; its graphics are not distributed proportionately. It needs to be broken down into equal sized tiles with one animation frame in each tile, which is not the case.

If you are comfortable with computer graphics work; then do the following.

1. Obtain the Gimp if you don't have Photoshop.

2. Create a new transparent background image or black background image, preferably 1024,1024 pixels in size to leave room for any future new frames. It does not have to be that size for 2D use, but is a good habit of using powers of 2.

3. Show the grid, adjust it in preferences/options. Set the grid size to 64 pixels.

4. If you want a transparent background, open the original sprite map and select the backdrop with the magic wand tool, double click the background layer or right click and convert into a layer. Then delete the backdrop.

4. Copy each frame into each grid tile on a seperate layer. Make sure anti-aliasing is active if you want transparency for better results. Keep each frame in seperate layers so you can easily move them around individually to tweak the animation.

Don't worry about the excess room, leave that for new animations.

jerryd
6
Years of Service
User Offline
Joined: 20th Feb 2013
Location:
Posted: 30th Mar 2013 06:23
Thanks Chris.
I just downloaded "GIMP". I'll have to read the users manual
and then I'll use it to fix this sprite sheet.

Jerryd
Chris Tate
DBPro Master
11
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 30th Mar 2013 10:58
Check out video tutorials as well; they are a good supplement for learning it.

Login to post a reply

Server time is: 2020-01-19 15:24:55
Your offset time is: 2020-01-19 15:24:55