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 / Makeing a sprite?

Author
Message
The Real 87
20
Years of Service
User Offline
Joined: 3rd Mar 2004
Location: somewhere between 86 and 88
Posted: 9th Mar 2004 01:51
How do I turn an image into a sprite?

Badger badger badger badger badger
Mushroom mushroom
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 9th Mar 2004 02:34
load image "myspriteimage.bmp",1


do


sprite 1,100,100,1


loop



hope i helped,
Bishop

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
The Real 87
20
Years of Service
User Offline
Joined: 3rd Mar 2004
Location: somewhere between 86 and 88
Posted: 9th Mar 2004 06:11
but myspriteimage would be an image not a sprite, aren't they different?

Badger badger badger badger badger
Mushroom mushroom
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 11th Mar 2004 23:26
yes! but the program will need to know what image to use for the sprite, (it needs to know what the sprite will look like so you need to supply an image of it) so you load an image and then in the sprite command the last number is the number of the image you are using for the sprite, so if you load the image "stardestroyer.bmp" into image 1 then the command to display the sprite would be

sprite 1,100,100,1

if you wanted 20 sprites that used the same image then you would do something like

for sprite=1 to 20
sprite sprite,100+(i*20),i*20,1
next i

and that would give you twenty sprites on the screen that all looked the same, ideal for bullets for example, you don`t want to have to load 100 images that all look the same just to have 100 bullets onscreen at the same time, and by changing the image number you can make the sprite animate or explode or die or whatever you want, hope thats some help, cheers.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 12th Mar 2004 00:08
First you must load an image

Load Image "MyImage.JPG",1

Then you must create a sprite. Creating the sprite simply makes a 3D Plain and locks it to the camera, texturing it with the image you specify. So when you say

Sprite 1,0,0,1

It creates a Sprite labeled 1, at the cordinates of 0,0 and textures the sprite with the Image tagged with 1.


We need help! Email us! join@eternaldestinyonline.com

Login to post a reply

Server time is: 2024-11-26 07:29:54
Your offset time is: 2024-11-26 07:29:54