What is the best part of a game to you? The sweet end music? The awesome rewards? Well, for me, it was always power-ups, there is nothing more staple in video games than a power up. I mean, who doesn’t know what a Mario mushroom looks like by 2018? That’s what I have been working on lately, making simple power-ups that make a game feel more alive.
In short, power-ups are simple in concept, but quite demanding in knowledge of code. A simple speed up zone involves layers of code and work, just to move a player character faster. For example, the “zone” for that power up, must know when it collides with the player character, but also it needs to let the player object pass through. Then, once the player starts moving through the speed up, what happens? That’s where “CollisionPersists” functions show up.
So now, they have sped up, but what happens when they leave the zone? That is where “CollisionPersists” becomes handy. A “CollisionPersists” function only “turns on” while the two objects touch, once they stop touching, it turns itself off, setting the player speed back to normal!
It sounds simple, and logically it is, but the code is difficult to write, but a lot of fun when it works. I have really been enjoying making my simple test game feel more like a real game, and I think this is a big first step towards something fun to play.
Image – https://giphy.com/gifs/car-cars-top-gear-S7rcze8TrXof6