Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
I want to have a character that I can spawn multiple times on the screen, and have them all behave in the same way.
Right now I am using UIImageViews in my games, but i need to be able to keep track of each character and destroy them individually as necessary.
I'm doing the same type of thing in my game. You need to make a UIImageView for each character you put on the screen, then put them all into an array, then use a for loop to go through the array and do your actions for each character. Then when you want to destroy one, you just remove it from the array and the view. If you want example code for this, I made a post titled "need help looping through an array". Does this help?
Thanks everyone! this is exactly the kinds of things I need. I will try subclassing a UIImageView. I think thats more of what I'm going for. I think I will give the array method a try as well.
Thanks everyone! this is exactly the kinds of things I need. I will try subclassing a UIImageView. I think thats more of what I'm going for. I think I will give the array method a try as well.
-michael
no don't do that. Add a new file to your project and just make it a class. You don't need a view for a class you want to make.
Replies
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome-michael
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThis is exactly what you need right here: Objective-C creating objects, methods and variables
Teaches you how to create the class and create new objects of the class.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome