Springs

Springs are a pretty standard object in many 2D platformers, but you may want the spring to act differently depending on the game. Typically, a spring will bounce the object up with the same force as it when it hit the spring.

This means that the player’s max height from hitting the spring will be equal to the peak of their jump before landing on the spring. In a realistic spring model, any added height would come from the person exerting force on the spring with their legs to reach a higher point. Although this model makes sense, it isn’t always the best from a gameplay standpoint. I might change the spring behavior to suit my game better. If the max height reached by the player from jumping on the spring is the same no matter how they approach it, it would make designing levels a bit easier. Another advantage would be that the player understands how to use the spring and what it does very quickly, making precise jumps easy to execute. I accomplish this by multiplying the player’s upward force by a constant when they come into contact with the spring, creating a height value that the player will always reach after hitting the spring.

Also, this is probably a good time to talk about designing the actual spring itself. Because the project is so early on, I’m not committed to any particular design. With that being said, I already have a pretty specific process for creating all of the objects in the game world. Here is the basic spring

All of the objects in the game have stuck to a couple basic ideas. The outlines are very thick, and there is almost no detail inside the object. Aside from that, you might notice something else about this object: There isn’t any color! The reason I do this is to remain as flexible as possible. C# XNA lets me set the color of an object inside of the draw method. Pretty cool, huh? Of course this only works if the texture of the object is entirely monochromatic, otherwise you end up with a muddled combination of colors. The advantage of this is that I can quickly see what this object would look like in any color I want, and apply that to every spring in the game. The biggest disadvantage, however, is that I cannot use a combination of colors. This isn’t a big deal, since the spring is pretty simple, but in order to add more than one color I’d have to edit the base texture itself. I can worry about this later on, when I’ve settled on something I like.

This entry was posted in art, design and tagged . Bookmark the permalink.

One Response to Springs

  1. Pingback: Weekend Update | Kanro Games

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>