Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there!
I am making a space invaders game for iphone with xcode. You can move the ship to the right or to the left when pressing the right or the left part of the window.
The "enemies" appear randomly at the top of the window, but the problem is that when a new enemy appears, the ship returns to the initial position, which is bottom center.
An example: say that you want to move the ship to the right, so you press the window and the ship moves towards the x direction, but when a new invader comes in, the ship returns automatically to its initial position.

I'm using a custom UIView class for the ship and I overwrote the drawRect: method. The invaders are UIImageView class images and I add them to the main view.

Any help or suggestion?

Thanks in advance!

EDIT: I realised that when pressing a button that changes the view, the ship also returns... So I imagine that the problem is that when I update the view, the ship goes back...
Please help! :)
Posted
Updated 17-Nov-13 22:57pm
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900