Coding Experiment - EKANS! - destructoid

Community Blogs   |   New  

6:24 PM on 06.10.2010

alexandersshen says:

Coding Experiment - EKANS!




I spent some time this morning thinking about mini-games to add to my newest project Penny. No details really, but I decided adding a Snake type game would be nice. In an effort to strengthen my coding skills, I decided to whip one up together with the greatest Pokemon ever (http://www.destructoid.com/why-ekans-is-the-best-pokemon-168461.phtml).

There are many different ways to implement the code, but the way I approached it was that each segment has two states: where it was and where it's going. With each tick of the game loop, it will move to where it's supposed to be going. The body piece behind it will set it's "where it's going" to the "where it was" of the piece in front of it. This way I don't have to queue up a huge list of turns. It will always know where to go as long as there's something in front of it.

Overall I think it worked out pretty well and I learned something today and that's a good thing. Play link below!

Related Link: http://www.shengames.com/flash/ekans/

Was it epic? Vote it up




fa-follow
alexandersshen



Those who have come:


More community blogs  


Get comment replies by email.     settings



Unsavory comments? Please report harassment, spam, and hate speech to our comment moderators

Can't see comments? Anti-virus apps like Avast or some browser extensions can cause this. Easy fix: Add   [*].disqus.com   to your security software's whitelist.




Back to Top