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.

DarkBASIC Discussion / Help With Sprites

Author
Message
MaTt0344
21
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 29th Feb 2004 22:15
I am making a space invaders game and so far have enemies that move back and forth across the screen and a plane that shoots missels but when I reload the missels don't move anymore. I am posting the code and I know it need some bitmaps with it but if anyone can tell just form looking at it why the missels don't move after I reload then that world be helpful.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 1st Mar 2004 07:24
I'd be glad to help, but could you give us the dimensions for each of the images. I know I can look at your image getting sections to determine that, but the code may not always be that easy to read. Say your space.bmp is 400x400 we'll be able to just make a image that's 400x400 that says "space.bmp" on it for reference.

Whoa....I just now realized your program structure calls for different images for EACH enemy sprite. If they are all going to look the same, you only need one image.` Example:

rem Load the spaceship image
LOAD IMAGE "spaceship.bmp",1

rem Create ten sprites from spaceship image
for i=1 to 10
sprite i,x,y,1
next

Of course if you want different images for each sprite, just use LOAD IMAGE for each ship image, and then make your sprites as needed. I'll check out your missile problem in a sec, but shortening your code with this method could make it easier to find the problem.

Crazy Donut Productions
Current Project: KillZone
MaTt0344
21
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 1st Mar 2004 23:44
The code doesn't call for a different image for each enemy sprite, I loaded a image into Bitmap 14 and used it for all 8 enemy sprites.

The image sizes are as follows(in pixels):
enemy-50x50
plane-51x50
space-800x600
missel-10x20
numbers-15x15
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 2nd Mar 2004 03:12
I've gotta run out right now, but real quick:
After fooling around with the CLI, I found that the reason your sprite did not show is because they did not exist. When you move the missel, then check if it's beyond the screen don't delete it. Just move it under the plane sprite, it will still be there, just invisible to the player. Then when spacebar is pressed you can let it fly.
You could even start by just having the missiles just placed under the plane to start with, and letting them fly as the spacebar is held.

Crazy Donut Productions
Current Project: KillZone
MaTt0344
21
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 2nd Mar 2004 03:48
ok thanks, i am going to try hide sprite instead of puting it under the plane
MaTt0344
21
Years of Service
User Offline
Joined: 6th Jan 2004
Location:
Posted: 2nd Mar 2004 03:57
Thanks for the help donut. I got the missels to work now. Now for the collisions and AI.

Login to post a reply

Server time is: 2025-05-22 17:12:06
Your offset time is: 2025-05-22 17:12:06