Attempting my first game, and hit a major roadblock...
I'm trying to make a space shooter. I'm DESPERATE of help so if anyone can help, let me know. The book doesn't address this issue (but if it does, it's hidden in the "Blocker" chapter, but I've spent hours staring at it and I can't figure it out)
So I have a space ship on the left. It shooting bullets rightward, but the bullet stops moving forward right when the next bullet is fired. So only one bullet moves at a time (and it would be the most recent bullet).
The way I programmed it, I used the screen refresh method to trigger it. On my view controller.m:
-(void) updateDisplay:(CADisplayLink *)sender
{
[fishFrames setFrame:gameModel.fishRect];
[bulletLv1 moveForward];
}
bulletLv1 is an instance of "bulletImageView" which is a subclass of UIImageView. and the "moveForward" method is defined as:
-(void) moveForward
{
self.center = CGPointMake(self.center.x +10, self.center.y);
}
My main issue is I don't know how to have multiple versions of the same object move independently. I'm guessing I might need to use MSMutable Arrays but I don't know. If anyone has any advice thanks...
|