platformer game - tips
So you wanna make 2D platformer game? Here are tips for you: 1. You need to check collisions between objects. Treat each object as a rectangle and check coordinates to examine if there is overlap. If there is, perform pixel based detection (there can be transparent pixels). 2. You can use tile map for making game levels 3. Objects can have "platform" property. If platform == null, they are falling because of gravity. But if objects is falling you still need to examine if there's collision with a platform. 4. To make various bonuses/collectable items that player can collect - make inventory object where each property is value of some bonus or feature: {energy: 100, gold: 10, spells: 20} // player properties and make bonus object look like this: {energy: 10, gold: 2} // bonus that adds 10 energy and 2 gold. you can also make some negative bonuses (e.g. poisons, thorns) {energy: -10, xp: 2} // it takes 10 points of energy, though it gives you 2 xp. Read also about multisets...