PDA

View Full Version : Shoot- Help!-



mongoixp
13-10-2010, 08:06 PM
Hello Everyone I'm Here because i need some help. i made all the parts of my game but i cant make the shoot part can anyone help me?

PS: I'm Using Delphix(It's old but it still work)

WILL
13-10-2010, 08:40 PM
Hi and welcome to PGD! :)

You'll have to give us a bit more information about what exactly you need to know. First it would help to know what kind of game you are making. And second, what are you "shooting" with and at? Also do keep in mind that we can help you with the math and maybe some of the physics, but it'll ultimately be up to do the coding yourself. It's not hard, but it does take the effort to learn. But first we need more details in order to offer our advice.

Also, you my find that game and graphics libraries have come a long long way since DelphiX was the big thing. If you didn't know there are lots of alternatives, just have a look around the site and you'll be able to read about them. :)

mongoixp
14-10-2010, 12:01 AM
Well, I'm Making a game like the old Berzerk for Atari. I Make all part from player movimentation to Enemy AI but i can't make the shoot My friend send me this code:

If isbutton1 in Form1.DXInput1.States then
begin
With TTiro.Create(Form1.DXSpriteEngine1.Engine) do
begin
Tiro.Image:= Form1.DXImageList1.Items.Find('tiro');
Tiro.X:= Nave.X;
Tiro.Y:= Nave.Y;
Tiro.Height:= Tiro.Image.Height;
Tiro.Width:= Tiro.Image.Width;
end;
end;
But when i try it , somehow give acess violation

chronozphere
14-10-2010, 11:06 AM
First of all... please use [ code ] tags in your posts. Makes it more readable. :)

Second. Try this:


If isbutton1 in Form1.DXInput1.States then
begin
With TTiro.Create(Form1.DXSpriteEngine1.Engine) do
begin
Image:= Form1.DXImageList1.Items.Find('tiro');
X:= Nave.X;
Y:= Nave.Y;
Height:= Image.Height;
Width:= Image.Width;
end;
end;


I think this should solve your Access violation problem :)

User137
14-10-2010, 01:36 PM
Well, I'm Making a game like the old Berzerk for Atari. I Make all part from player movimentation to Enemy AI but i can't make the shoot My friend send me this code:

If isbutton1 in Form1.DXInput1.States then
begin
With TTiro.Create(Form1.DXSpriteEngine1.Engine) do
begin
Tiro.Image:= Form1.DXImageList1.Items.Find('tiro');
...
But when i try it , somehow give acess violation
Where did you create Tiro object? If it isn't created it will give access violation at that point. If you need that variable you can do this also:

If isbutton1 in Form1.DXInput1.States then
begin
tiro := TTiro.Create(Form1.DXSpriteEngine1.Engine);
With tiro do
begin
Image:= Form1.DXImageList1.Items.Find('tiro');
...