Results 1 to 5 of 5

Thread: Shoot- Help!-

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Location
    19¬? 44′ 52″ S, 47¬? 55′ 55″ W
    Posts
    4

    Question Shoot- Help!-

    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)

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    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.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #3
    Junior Member
    Join Date
    Oct 2010
    Location
    19¬? 44′ 52″ S, 47¬? 55′ 55″ W
    Posts
    4
    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:
    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
    Last edited by WILL; 14-10-2010 at 04:31 PM. Reason: placed your code into a code block

  4. #4
    First of all... please use [ code ] tags in your posts. Makes it more readable.

    Second. Try this:
    Code:
    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
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  5. #5
    Quote Originally Posted by mongoixp View Post
    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:
    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:
    Code:
    If isbutton1 in Form1.DXInput1.States then 
    begin
    tiro := TTiro.Create(Form1.DXSpriteEngine1.Engine);
    With tiro do 
       begin 
         Image:= Form1.DXImageList1.Items.Find('tiro'); 
        ...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •