Quantcast
Community Discussion: Blog by alexandersshen | Coding Experiment - EKANS!Destructoid
Coding Experiment - EKANS! - Destructoid




Game database:   #ABCDEFGHIJKLMNOPQRSTUVWXYZ         ALL     Xbox One     PS4     360     PS3     WiiU     Wii     PC     3DS     DS     PS Vita     PSP     iOS     Android




About
Just another child of the 80s whose memories of old cartoons and video games reflect a much simpler and much more ignorant time.

He also likes to draw the comics.

Website: http://www.alexandershen.com
Player Profile
Follow me:
alexandersshen's sites
Badges
Following  




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/
Photo



Is this blog awesome? Vote it up!




Those who have come:



Comments not appearing? Anti-virus apps like Avast or some browser extensions can cause this.
Easy fix: Add   [*].disqus.com   to your software's white list. Tada! Happy comments time again.

Did you know? You can now get daily or weekly email notifications when humans reply to your comments.


Back to Top




All content is yours to recycle through our Creative Commons License permitting non-commercial sharing requiring attribution. Our communities are obsessed with videoGames, movies, anime, and toys.

Living the dream since March 16, 2006

Advertising on destructoid is available: Please contact them to learn more