Hopscotch Laser Snake clone

315 views
Skip to first unread message

Scott Ferguson

unread,
Oct 24, 2015, 1:34:01 PM10/24/15
to app-inventor-de...@googlegroups.com
Guide the laser beam to the End marker.
Two levels and a free play mode.
Add more levels!



See a YouTube video of game play with the original Hopscotch version here.

This is what I came up with after watching a few videos of people playing this interesting game.

The way it was done with App Inventor should be fairly easy to understand.

I have not seen the original Hopscotch coding to see how they did it originally, but the AI clone game play looks the same to me.

For each level the player positions from one to four prisms between a Laser marker and an End marker, then taps a Play button.
If the prisms are placed correctly, the laser beam will bounce off each of the prisms and end at the End marker.

Here is how it works:
A small laser beam sprite is set in motion using the sprite Speed and Heading properties.
A clock Timer is used With DrawLine to trace a line behind the laser beam sprite.
When the beam strikes (CollidedWith event) one of four 'prisms' (Square ImageSprites), that prism has a Heading associated with it, and the laser sprite's heading is changed accordingly.
That is pretty simple and effective!
When the beam sprite touches the End marker (a round ImageSprite) the level is complete.
If the beam hits one of the Canvas edges, a 'Try again?' Notifier alert is displayed and the player can reposition the prisms and tap the Play button again.

When both levels are completed, a free play mode allows the Laser and End markers to be positioned anywhere on the screen for the player to make a custom challenge or test a prospective new level to be added to the game.
---
sf
LaserSnake.aia
Reply all
Reply to author
Forward
0 new messages