Im making a very simple SHOOTER game need some Help PLease.

Discussion in 'Public Game Developers Forum' started by CladCreations, Mar 1, 2009.

  1. CladCreations

    CladCreations Member

    Feb 23, 2009
    14
    0
    0
    I want to make a image in this case a "plane" shoot I have the air plane image I want to use I want it to move on its own kinda float but able to move around the screen, detect touches and shoot. please help TUTS or anything would be very much appreciate. Thnx for your replies.
     
  2. ibelongintheforums

    ibelongintheforums Well-Known Member

    Jan 4, 2009
    2,716
    390
    0
    so u want a image from your description?
     
  3. Ph4ntom4

    Ph4ntom4 Well-Known Member

    Jan 10, 2009
    467
    0
    0
    #3 Ph4ntom4, Mar 2, 2009
    Last edited: Mar 2, 2009
    How are you making your app?
     
  4. BulletDev

    BulletDev Well-Known Member

    Sep 20, 2008
    784
    40
    0
    produce applications under "Bullet Development"
    Vancouver, BC
    Do you know any programming languages such as C++ or Objective C?

    Please say yes....
     
  5. CladCreations

    CladCreations Member

    Feb 23, 2009
    14
    0
    0
    yes i do know some but im very new to programming.
    i Simply want to make my image when you tap on it to fire a shot. :confused:
     
  6. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    It sounds like you want to have an image view hidden and then when you tap it appears. What you do is make a name for your image view and then make it disappear of reappear: IBOutlet UIImageView *planePicture; in the .h file and then in the .m under your IBAction put: planePicture.hidden = YES; or planePicture.hidden = No; I hope this helped!
     
  7. CladCreations

    CladCreations Member

    Feb 23, 2009
    14
    0
    0
    I guess what I mean is if I take my image of a plane put it in a UIButton.
    From here How do I get it to recognize a touche so I can fire a shot??? please somebody help lol :D
     
  8. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    #8 WellSpentYouth, Mar 2, 2009
    Last edited: Mar 2, 2009
    Do you know how to do the animation for your shot? If so, all you do is make a button (declare and all that stuff) in view did load, and put your animation of a shot in the method of the button (in the .m) and then do (view did load) picturePlane.hidden = YES; and then in the button method do picturePlane.hidden = NO; and then the animation. If this doesn't make sense, PM me. The code is for a sprite animation. If I am correct, put this in the .m file in view did load and then @synthesize plane; at the top of .m and then in .h

    NSTimer* animationTimer;
    IBOutlet UIImageView *plane;

    @property(nonatomic, retain) IBOutlet UIImageView* plane;

    - (void)animatePig;
    - (IBAction)animate;




    View did load:



    animationTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0/1.0)
    target:self selector:mad:selector(tick) userInfo:nil repeats:YES];

    [animationTimer setFireDate:[NSDate distantFuture]];
    plane.hidden = YES;

    [super viewDidLoad];
    }

    - (IBAction)animate{

    [animationTimer setFireDate:[NSDate date]];
    }



    - (void)tick{
    [self animatePlane];
    }

    - (void)animatePig{
    pig.hidden = NO;
    UIImage* planeImage1 = [UIImage imageNamed:mad:"4.png"];
    UIImage* planeImage2 = [UIImage imageNamed:mad:"5.png"];
    UIImage* planeImage3 = [UIImage imageNamed:mad:"6.png"];
    UIImage* planeImage4 = [UIImage imageNamed:mad:"7.png"];


    if(plane.image == planeImage1)
    plane.image = planeImage2;
    else if(plane.image == planeImage2)
    plane.image = planeImage3;
    else if(plane.image == planeImage3)
    plane.image = planeImage4;
    else{
    plane.image = pigImage1;
    [animationTimer setFireDate:[NSDate distantFuture]]; //This effectively pauses the timer
    plane.hidden = YES;
    }
     
  9. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    Did my post help at all?
     
  10. Zincous

    Zincous Well-Known Member

    Dec 23, 2008
    4,567
    46
    36
    Sacramento, CA
    Lol there's a non-happy smiley in your code :p
     
  11. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    #11 WellSpentYouth, Mar 3, 2009
    Last edited: Mar 3, 2009
    The non-happy smile is a ": ("! LOL, I missed that!
     
  12. CladCreations

    CladCreations Member

    Feb 23, 2009
    14
    0
    0
    I couldn't get it to work I will try it again in the morning. I guess I don't completely understand it either
     
  13. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    Ok, so if you want to have a sprite appear when you press a button, and then disappear, then PM your e-mail address and I'll make you an xcode project!
     
  14. WellSpentYouth

    WellSpentYouth Well-Known Member

    Jan 11, 2009
    1,363
    6
    0
    iPhone programmer
    App Tech Studios, USA
    Ok, I made a project for you, just PM me your e-mail and I'll e-mail it to you!
     
  15. whackamole

    whackamole New Member

    Dec 23, 2010
    2
    0
    0
    may i ask what is the code to create those objects to appear and disappear? i am doing a whac a mole game and i need help in getting the screen for the mole to appear. thanks
     
  16. whackamole

    whackamole New Member

    Dec 23, 2010
    2
    0
    0
    need help in whackamole

    may i ask what is the code to create those objects to appear and disappear? i am doing a whac a mole game and i need help in getting the screen for the mole to appear. thanks
     
  17. matt1413

    matt1413 Member

    Jan 3, 2010
    13
    0
    0
    I found that hilarious for some reason :D
     

Share This Page