Showing posts with label Game. Show all posts
Showing posts with label Game. Show all posts

Wednesday, February 9, 2022

React native swipe gestures handler example

This is a simple 2048 game demonstrates how to use gestures handler in react native


It is hosted in play store, feel free to install and see the demo

It is using npm react-native-swipe-gestures package to detect swipe. this component can be used handling swipe gestures in up, down, left and right direction.

Here is the complete github code link

https://github.com/madan712/2048

Code snippet


Wednesday, September 24, 2014

Javascript code for 2048 number puzzle

Other day I was playing this game on my android mobile and I was so amazed with it that I thought why not try to write a JavaScript code for this game. So here I am with it.

new game

Score :

HOW TO PLAY: Use your arrow keys to move the tiles.

Please see the complete source code -


Output -

Saturday, September 8, 2012

How to create a Jigsaw puzzle using JSP and Javasacript?


What is Jigsaw puzzle?
A Jigsaw puzzle is a tiling puzzle that requires the assembly of numerous small pieces. Each piece usually has a small part of a picture on it; when complete, a jigsaw puzzle produces a complete picture.

In this article we will see how to create a Jigsaw puzzle using javascript. Initially you will require to cut an image into various pieces, that can be done using a simple java program.

Please see the below Java program that will cut an image into number of pieces for a Jigsaw puzzle. Just provide the desire number of rows and column, it will automatically cut an image into that number of pieces.

Please see the self explanatory Java program below