Click here to Skip to main content
Click here to Skip to main content

Frog Puzzled

By , 17 Oct 2012
 

Please note

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.

Introduction 

Frog Puzzled is an HTML5 game where the objective is to help the puzzled frog. You can jump, dart and generally scratch your head, or the frogs, till the puzzle is solved. 

The main objective of the game is to move a certain set of blocks onto another set of blocks. If all the blocks are moved successfully the level is solved. The frog is moved using the arrow keys. If the frog has no path to move through or there are two or more blocks adjacent, the level cannot be solved. There can be more than one path to a particular solution and any solution is not necessarily the shortest path. With practice, levels can be solved with speed and with the least number of moves. 

There are 10 levels currently with more coming soon! Stay tuned. 

Screenshot 

The Code

HTML5-JavaScript appears to be the new standard targeted by app developers, since it enables code reuse, cross-platform deployment, and the ability to target any device running a standards compliant web browser.

Intel AppUp® encapsulator available at  http://software.intel.com/en-us/appup/encapsulator is being used to wrap the web app as a Windows 8 desktop app. 

To make the game canvas resizable for different resolutions and for change in orientation the following algorithm is used. 

IF the Inner Height/Inner Width of the window is greater than inverse of screen aspect ratio   THEN
 Screen Height = Screen Width * inverse of aspect ratio
 ELSE  Screen Width = Screen Height * aspect ratio

I hope this helps anyone facing issues with different screen resolutions and being able to scale the canvas to fill the screen in either orientation while maintaining the aspect ratio, so that graphics are not distorted and the canvas is not stretched or truncated when resolutions change.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Kurosh F.
Software Developer
India India
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 17 Oct 2012
Article Copyright 2012 by Kurosh F.
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid