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.

2D All the way! / How do you create sprites?

Author
Message
SuperCort2003
20
Years of Service
User Offline
Joined: 7th Jul 2003
Location: Metropolis
Posted: 10th Jul 2003 02:52
[b]Hey everyone. I just got another question for everyone which is how did you make your sprites? Well anyway thanks!

SuperCort2003@aol.com
Drum
20
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 10th Jul 2003 05:07
Basicly to make a sprite you use the following code


So an example of this is:


Got it?
sorry cant explain it well. I just woke up.
zenassem
20
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 10th Jul 2003 21:35
Are you asking how we make=draw them?
Personally I use Paint Shop Pro or The Gimp which is Open Source, Free, and available for win32 platform. My method is old an terrible, as I actually draw them pixel by pixel. Usually I create a solid color form (or basic colors) of the sprite and save it. I then add detail to the sprite. I try to make use of mirroring them so that I only have to draw half. Then I make changes so that it doesn't look like I cheated. For different angles (for example people) i go back to the original form and cut, paste, and weld it until It looks ok. Then I go through the process of adding details again.

This is a very time consuming and archaic method to say the least. For demo's i usually download already generated sprite tables to save time.

SuperCort2003
20
Years of Service
User Offline
Joined: 7th Jul 2003
Location: Metropolis
Posted: 10th Jul 2003 21:50
Thanks guys for the help but I've got another issue. I don't have DB Pro but I do have DB and it's just hard for me to understand how to put my sprite in DarkBAsic. Drum you tried to help me but I'm just confused. I created a sprite of me as a cartoon character and I want it to just appear on DarkBasic and I move it around but I can't even get it on DarkBasic. Just what is spritenumber because the name of my file is sprite.bmp but I mean how do I put it in. I'm a newbie I know but I just need help. Thanks for your replies.

SuperCort2003
iannai
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location:
Posted: 11th Jul 2003 22:23
ok, I think something like this:



I am a newbie too, but I hope this is useful

Spiderman
20
Years of Service
User Offline
Joined: 26th Jul 2003
Location: Canada
Posted: 31st Jul 2003 20:16
How do you separate frames of sprites?

"If the theory doesn't fit the facts, change the facts" -Einstein
zzabb
20
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 1st Aug 2003 05:40
by using the pixel width and height of each frame of the drawing

the 'get image' command

GET IMAGE Image Number, Left, Top, Right, Bottom

a simple code to load all of the frames

LOAD BITMAP "name of bitmap here.bmp",1
number = 1
FOR j = 0 to 3
FOR i=0 to 2
GET IMAGE number,i*64,j*64,(i+1)*64,(j+1)*64
INC number
NEXT i
NEXT j
delete bitmap 1

my pixel width and hieght is 64
j is the number of frames wide
i is the number of frames high
number is the number of the image of the frame

so if you add it to the code above you have
(i added a counter to slow down your animation i set it to 50 if you make the counter number smaller your animation will go faster if you make the counter number larger your animation will go slower)


sync on
sync rate 40
hide mouse

LOAD BITMAP "name of bitmap here.bmp",1
number = 1
FOR j = 0 to 3
FOR i=0 to 2
GET IMAGE number,i*,j*103,(i+1)*103,(j+1)*103
INC number
NEXT i
NEXT j
delete bitmap 1

frame = 0
counter = 0

x=100
y=100

sprite 1,x,y,1

do
inc counter
if counter =>50
inc frame
if frame = number then frame = 1
if counter =>50 then counter = 0
endif

if upkey()=1 then y=y-5
if downkey()=1 then y=y+5
if rightkey()=1 then x=x+5
if leftkey()=1 then x=x-5
sprite 1,x,y,frame
sync
loop


i hope it helps

My advice is free -
unfortunately you get what you pay for (-:
zzabb
20
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 1st Aug 2003 05:58
oops the frame should be set to 1 in the above post
frame = 1

My advice is free -
unfortunately you get what you pay for (-:

Login to post a reply

Server time is: 2024-02-27 20:27:26
Your offset time is: 2024-02-27 20:27:26