I am working at a platform game and I would like to know the best methods to do the following:
1. Enemies will have different sizes. How can I stomp/squeeze (Mario style) the small ones (smaller then player's height) and stay above the big ones (bigger then player's height) ?
Following this tutorial I learned how to stomp the smaller enemies and not stomp the bigger ones. How can I make the player to stay above bigger ones ? I am thinking about the Solid behavior, but I would like make the enemies overlap each other (to be able to create crowd/herds of enemies).
2. The player will have 2 behaviors (platform and bullet) with different sprite sizes. Witch method is better or more recommended ?
Method 1:
- Create only one player
- Assign it the platform and bullet behaviors
- Only one behavior being active at time, switch the behaviors (and the sprites/animation) when needed
Method 2:
- Create 2 players
- Assign a behavior to each player
- Switch between players when needed (destroy the current player and create the other one)