Bitwise Shift Operators

Write to Your Note Don’t learn it then forget it.

Bitwise Shift Operators

This operators are often forgotten, but by using this operator will save memory and is more secure, especially on   game programming and encryption techniques.

Bitwise Shift Right operator “>>”
64 >> 1, then 64 is converted into a binary number 1000000 then shifted 1 bit to the right to be 100000, so 64 >> 1 = 32. To facilitate recall x >> n then any shift to the right then x will be divided by 2 n
64 >> 1 = 32, because 64: 2 = 32
64 >> 2 = 16, because 64: 2: 2 = 16
64 >> 3 = 8, because 64: 2: 2: 2 = 8
63 >> 1 this would mean 63: 2 = 31, the result is an integer

Bitwise Shift Left operator “<<“
To the left is the opposite of the slide slide right
8 ‘<<‘ 1 then 8 is converted into a binary number to 1000. Then do the shift by 1 bit to the left. So that original 1000 will be 10000 (at the time of shifting the rightmost value is filled with bits 0)
8 ‘<<‘ 1 = 16 for 8 x 2 = 16
8 ‘<<‘ 2 = 32 for 8 x 2 x 2 = 32
8 ‘<<‘ 3 = 64 for 8 x 2 x 2 x 2 = 64

Bitwise Shift Operators Zero Fill “>>>”
Leftmost bit (high-order bit) is used to determine the sign (sign) of a number (whether positive or negative). Bit value of 0 indicates a positive value and a bit value of 1 indicates a negative value. Example: Continue reading

Build a Simple Grid Game Web Base with Artificial Intellegence (AI) in HTML 5 Javascript and Jquery Run in Everywhere – Part 3

Final Project HTML5 JavaScript: Implementation Hierarchical

Pathfinding A Star (HPA*) Algorithm on Grid Game &

Algorithm Simulation for comparing A Star

Algorithm and Hierarchical

Pathfinding A Star

Algorithm

This is the last task of course. Whether it is useful or not, good ending or not, but I’ve tried my best. This is me with myriad my lack.
I only try to learn, for what I live, why I live , why I am happy to learn this all, what is the purpose of my life actually,  anyone can explain it?

Download Project => FindYourLetters.zip

Picture of Game FindYourLetter

2

red color indicates the HPA* is applied to enemies for 5 seconds

Picture of Algorithm Simulation

Continue reading

Mobile Web Application Collection with PhoneGap for Android

just sharing than not at all

because knowledge should be free

Simple Collection of Mobile Web Task

So far I can only do that can I share, without talk too much, because I am not good at talking. you have to know it.

I only can be channeling my thoughts through writing so much.. … oh no it’s only my problem not your business…

forget it.. >.<

Easy to Start Build a Web Using CakePHP with Interactive Bake Shell

CakePHP makes building web applications simpler, faster and require less code

Step 1: Donwload XAMPP for apache & mysql if you’re not have it. Download from apachefriends.org and install it.13

Step 2: Download CakePHP from cakephp.org and extract it.

15

Step 3: Then put it into C:\xampp\htdocs and rename with your website name.

Step 4: Run from localhost => localhost/davidmarkal, then will appear NOTICE Continue reading

Build a Simple Grid Game Web Base with Artificial Intellegence (AI) in HTML 5 Javascript and Jquery Run in Everywhere – Part 2

Shift the Map Display on Canvas HTML5 and Javascript using Translate Offset & mouse click-move

At this part we will begin make a simple grid game map with html5-JS-Jquery for shift the map display using mouse click and mouse move.Translate map used to large map that the screen can not display all .. .. ..

index.html

<!DOCTYPE html>
<html>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no”  />
<title>ShiftMapDisplay</title>
<script type=”text/javascript” src=”js/jquery-1.7.2.min.js” charset=”utf-8″></script>
<link href=”css/jquery.mobile-1.1.0.min.css” rel=”stylesheet” type=”text/css”/>
<link href=”css/jquery.mobile.theme-1.1.0.css” rel=”stylesheet” type=”text/css”/>
<link rel=”stylesheet” href=”style.css” type=”text/css”>
<script src=”script.js” type=”text/javascript”></script>
</head> Continue reading

Build a Simple Grid Game Web Base with Artificial Intellegence (AI) in HTML 5 Javascript and Jquery Run in Everywhere – Part 1

.

“WRITE ONCE IN BLOG READ ANYWHERE BY INTERNET” 😛 😛 😀

JUST TO LEARN HOW TO MAKE A SIMPLE GAME IN HTML5 JS AND JQUERY

NewBieOnly!

.

Html 5 tag that you must know it :
<!DOCTYPE html>
<html>
<head>
<title>SimpleGridGame</title>
</head>
<body>
<canvas id=”yourcanvasId” width=”480″ height=”640″></canvas>
</body>
</html>
Example of Javascript implementation:
– build 2d array in js for Grid Map
For example we make array with size : 30x10var map1 = [
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0],
[0,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,0],
[0,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0],
[0,2,1,2,0,2,0,2,0,0,2,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,2,1,0],
[0,2,1,2,0,2,0,2,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0],
[0,2,1,2,0,2,0,2,0,0,2,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,2,1,0], Continue reading

BASICS OF HTML 5 JAVASCRIPT CANVAS

TRY To Do IT !!!

index.html code:

<!DOCTYPE HTML>
<html>
<head>
http://script.js
<style>
canvas {
border-width: 1px;
border-style: solid;
}
</style>
</head>
<body>
<center>
<canvas id=”canvasId” width=”640″ height=”480″>
</canvas>
</center>
</body>
</html>

script.js code:

//make a line

window.onload = function(){
var canvas = document.getElementById(“canvasId”);
var ctx= canvas.getContext(“2d”);
ctx.moveTo(10,10);  //x,y is start point
ctx.lineTo(100,20);  //x1,y1 is end point Continue reading

Using simple AJAX for displaying contents

This below is ajax script for displaying contents.

For example:

There is page.php.

We can put this script between <header>script</header>

<script type=”text/javascript” src=”javascripts/jquery-1.5.min.js”></script>
<script type=”text/javascript”>
<script type=”text/javascript”>
$(function() {
$(‘#menu a’).click(function() {
var url = $(this).attr(‘href’); Continue reading

Easy menu with Css and Javascript

Save the code with name SpryMenuBar.js

var Spry; if (!Spry) Spry = {}; if (!Spry.Widget) Spry.Widget = {};

// SpryMenuBar.js – version 0.12 – Spry Pre-Release 1.6.1
// Copyright  (c)  2006.  Adobe Systems Incorporated.

Spry.BrowserSniff = function()
{
var b = navigator.appName.toString();
var up = navigator.platform.toString();
var ua = navigator.userAgent.toString(); Continue reading