Help - Search - Members - Calendar
Full Version: A Little Problem
Zymic Webmaster Forums > Web Design & Development > Client Side Scripting > JavaScript
kcc
I have been trying this thing for a couple of days now but can not seem to get it done.

I'm making a game and am trying to make the sprite move on a map. It moves fine and error freely. Now I declared a variable for some stuff to appear random.

Now, the thing that I'm trying to do is, whenever the sprite moves on the map, the variable should be executed on every move, such that, the user of the game has a chance to get the random stuff at every move and have a chance.

I tried do it with evaluate and tried putting the move command in it but it did not work. I just need help with it.

The command I think would work would probably be >> eval << but I do not seem to get it properly.

Please help me a bit.
Motta
Dunno what you really want to do, but isn't easy to create a function to manipulate it?

like:
CODE
function doRandomStuff(){
    //do some randomness
}
function playerMove(){
   doRandomStuff();
   //move the player
}


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.