Jump to content
  • Advertisement
Sign in to follow this  
Smotsholle

JEDI SDL memory problem?

This topic is 4898 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working with delphi and so I'm using JEDI SDL. The documentation doesn't support the sprite-engine yet so I'll ask here. I'm trying to create a remake of a game called nemesis. It's a shooter so this means lots of bullets flying around. This causes the game to suddenly quit. Delphi gives some memory problem I guess (it shows some machine language) The Move command of the bullet looks like this: Procedure TBullet.Move; begin if x < 330 then inc(x, 8) else begin Kill; dec (BulletCount[parent]); end; end; Bulletcount is an array of 5 integers, it prevents the game from having more than 10 bullet sprites. My question to you: Does the Kill command remove the sprite from the sprite-engine or is there another sollution?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Are you sure parent is a valid index? Maybe that causes the error.
Isn't there a method 'Remove' in the sprite class? It's been some time since I used it.

Share this post


Link to post
Share on other sites
Parent is an integer value which points to the ship it belongs to, it can be anywhere in between 0 and 4...
A single ship can only have 2 of it's bullets on the screen. That is the bulletcount.

I just did some more testing... And I found yet another problem...
The ship can move in 8 directions (using the cursor keys)
The ship can shoot (using the spacebar)

When I press too many keys simultaneously for too long the game quits...
Should I limit the ship to 4 directions (only a single cursor key works) or is there a better sollution?

Share this post


Link to post
Share on other sites
Is it allowed to place a link to the code here?
I won't mind sharing my delphi source, and maybe you can determine what's wrong in there.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!