JEDI SDL memory problem?
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?
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.
Isn't there a method 'Remove' in the sprite class? It's been some time since I used it.
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?
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement