dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: HELP!! plz

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    113
    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

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Posts
    100
    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

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Posts
    113

    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

  4. #4
    Senior Member
    Join Date
    Jun 2002
    Posts
    113

    ??????

    ??????????????????????????

  5. #5
    Senior Member
    Join Date
    Jun 2002
    Posts
    113

    //////// ahhh nothin

    dgg nothin

  6. #6
    Senior Member
    Join Date
    Jun 2002
    Posts
    113

    aaaah im a

    IM a senitor member now

  7. #7
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center