Sunday, April 16, 2017

architecture - How should I structure my code to add enemies?


So I am currently making a 1942-style game in Sprite Kit. I've reached the point where I am finished implementing pretty much everything (movement, shooting (also recognizing a hit and exploding an object), menu,etc..) ..expect for enemies. Since I am not so experienced in programming I wasn't quite sure how I should implement my enemies.


I wanted to have different enemy "classes" in my game (in a way where they have different appearance / weapons, etc) and I also wanted the game to spawn stronger classes in the game with time. (e.g: at the beginning of the game there are green enemies with one-shot weapons; 3minutes in they should be red and fire two-shots)


How should I code my enemies? Should I do different classes (what I am currently thinking) or should I declare them with strings or do the properties with a .plist file? (on a side node: how can I access my plist properties from the scene code?)


Do you have other tips for me regarding enemies/classes/plist files?


Or..are there any other ways specifically in Sprite Kit to do this kind of stuff?




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...