-
Im working on a game were you kill osama the problem is i treid to make the java script code to make him disaper and show up in a random location be i does ent work can some one help me with this script
-
I know there are people who are good at this, but I suck when it comes to Javascript and Random location. I'm still a beginner with 3DFA. Sorry
-
im 13
so am im a beginner how old are you im 13 i no some java script like movment hide show some collisin deteck and some more
-
??????
??????????????????????????
-
-
-
KoolMoves Moderator
Re: aaaah im a
Originally posted by total_WAR2002
IM a senitor member now
Was it worth spamming the folder?
Copied from the 3dfa Help file:
Random numbers
- The 'random (value)' function can be used to generate a random number.
- The result will be a random whole number between zero and the specified value.
As an example, random(5) returns 0, 1, 2, 3, or 4.
ok so lets say your movie is 480x360.
This is sample code only use at your own risk
Code:
movie_width = 480;
movie_height = 360;
xpos = random(movie_width);
osama.position.x= xpos;
ypos = random(movie_height);
osama.position.y= ypos
will put your osama at a random point on screen
I was trying to figure out how to limit the range so that he wouldn't go partly off screen but it's late and I can't think of it. Seems I did it before but don't remember how now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|