Shooting


Goity

VIP Sleaze
Joined
Jun 22, 2004
Messages
5,598
Location
Isle of Ewe
Code:
PROCESS SHOT();

PRIVATE
FLGCOLLISION; 
BEGIN
y=GY;
x=GX;
Graph=4;
For(x=GX+40;x<320;x=x+50)
FLGCOLLISION = COLLISION(TYPE Sheep);
For(Graph=4;Graph<7;Graph=GRAPH+1)
Frame;
End
END

END

This is my code for my shoot process. I'm using a scrolling function, and when I go to the lower half of the screen, The Bullet Goes to a different part of the screen.
Anyone know how to fix this?
 
Is it possible that the GY and GX don`t get the actual values when change position on screen?

They have to be in a loop (in your "player" process) to get the new coordinates when you change your "players" position.

Oh, and I think you can eliminate the line x=GX; because you are making x=GX+40 in your "for" loop...

And be sure to kill the process, when the bullet (or whatever you shoot on that poor sheep) goes of screen, or kill them after travilling a certain distance, because they stay in memory if they aren`t killed and make your game slow/crash if to many of them are still loaded. (I hope you know what I mean, hard to explain in english)


Hmm, just thinking, I`m not into using scrolling yet, but maybe your x or y values get lower zero (ignore this, I think I`m talking crap)
 
No, they do work perfectly until I get to the lower half of the screen
(btw. this is just my very basic shoot function, when it's finished there's gonna be a lot more in there, but I want to get the basic function working properly first. This code (well, very very similar code) also worked in pigeon killer)
 
Oh, okay. But I don`t see anything other causing this, maybe you have to post the code for your players position, if you can`t find the bug yourself.
 
You don`t have to, if you don`t want to give your source away.
And I don`t know, if find any bug if you do so.

But I will try.

(You can also send it via e-mail, to keep it secret, if you want to)
 
Back
Top