issue adding ImageSprites to a TobjectList

General
clancy
2012-02-20
2013-05-14
  • clancy

    clancy - 2012-02-20

    this may be a bit more of a general question than one especially pertaining to Andorra2d, but I need help.
    This code:

    {
    }
    

    doesn't work. as far as I can tell, the Tbullet (A TimageSpriteEx deriviative) is being created as specified, but is not added to the TObjectList.
    If anyone can give me a hand, I would be much obliged.
    regards, Nerd.

     
  • clancy

    clancy - 2012-02-20

    oops, forgot to add the code:

     procedure MakeBullet(inputX, InputY, InputAngle : double; Info: byte);
     var MyBullet : Tbullet;
      begin
      MyBullet := Tbullet.Create(GameSpriteEngine);
      with Mybullet do
      begin
      Image := GameImageList.Find('bullet');
      MyBullet.X := InputX;
      MyBullet.Y := InputY;
      MyBullet.Angle := InputAngle;
      MyBullet.Finfo := Info;
      MyBullet.FHealth := 10;
      end;
       form4.bullets.Add(Mybullet)
       Mybullet.dead;
     end;
    
     
  • luarvic

    luarvic - 2012-07-18

    Mybullet.dead;
    your sprite is dead(freed) 

     

Log in to post a comment.