Monday, May 11, 2009

make a object stop after sometime

if (bullet.GetLinearVelocity().Length() < 0.001){
stoppedForFrames += 1;
}
else{
stoppedForFrames = 0;
}
if (stoppedForFrames >= 15){
trace("stopped");
}

Thursday, May 7, 2009

level lock code in AS3

write this code in 1st frame
/////////////////////////
var unLock:*;


var my_so:SharedObject = SharedObject.getLocal("store4");





if (my_so.size == 0) {

unLock = Level
;

} else {

unLock=my_so.data.UNLOCK





;
}


//////////////////////////////////
make movieclips (to show all levels)
//////
L1.buttonMode = true;//// its open
L1.addEventListener(MouseEvent.CLICK,LevelPlay);


function LevelPlay(e:Event) {
gotoAndStop("play");
distance_joint1();
Level=1

;
}
//////////////////



L2.addEventListener(MouseEvent.CLICK,LevelPlay1);///its closed


function LevelPlay1(e:Event) {

if(L2.buttonMode==true)
{
gotoAndStop("play");
distance_joint1();
Level=2
}

;
}

//////////

/// this is the code for making button visible and non visible
for( var i=1;i<=unLock;i++)
{
this["L"+i].buttonMode=true//mouseEnabled=true//alpha=0//buttonMode=true
//trace(this["L"+i])



}


//////////////////////////////////////

finaly in UPdate fucntion() pass the data and store it like this

//////////////////
my_so.data.UNLOCK=Level



my_so.flush()
my_so.close()

////////////////////////////////////////
its done :)

Monday, May 4, 2009

rafter game

If you want to run swf in blogspot
here is the code

/*
*/

Sunday, May 3, 2009

fan effect code done

i was thinking of making something with Fan
so i did 1 module as how can one make object to sustain in AIR. :)
well the concept behind this is just make one Base object and one target Object
then find this distance between them and applyforce in y direction

like this
var forcex=Math.round(body.GetPosition().x-wallB.GetPosition().x);
var forcey=Math.round(body.GetPosition().y-wallB.GetPosition().y);


trace(forcex)
if (Math.abs(forcex)>=1&&Math.abs(forcey)>=1) {
body.ApplyForce( new b2Vec2(10/forcex, 50/forcey), body.GetWorldCenter());
}

Saturday, April 11, 2009

Game Story

Hi
My name is rahul singh i am working as Game developer
i would like to share my experience about Gaming
Recently i did one Game called Rafter and this game got selected by Big Fish Games
so now i am quite excited about my future Games .

Tuesday, February 3, 2009

Friday, January 23, 2009

Friday, January 9, 2009

Tuesday, July 29, 2008

J2me Bg Scroll And Jump Code

Hi here is small code to make BG move And Player Jump...
jarFile
source Code

flash Bg Up Scroll Code

Hi i would like to introduce the concept of how to make BG Up scroll game in Flash.
CilckHere
SourceCode

FEEDJIT Live