Play free games online!


Go Back   The Game Homepage Forums > Development > Flash Development

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-31-2009, 05:46 PM
Gamer
Tin Can
 
Join Date: May 2009
Posts: 1
Vigilantae is on a distinguished road
Default Making an object move randomly

I'm working on a game where I want an object to move to a random place every couple of seconds. I don't know how to make the object move after being placed randomly for the first time. This is my current code:

onClipEvent(load){
this._x = random(600);
this._y = random(450);
}

Is there a way for me to add a timer that tells it when to move or something?
Any help would be appreciated.
Reply With Quote
  #2  
Old 06-02-2009, 10:27 PM
Bigmutha's Avatar
Gamer
Power Drill
Better than 72.36% Better than 72.36% Better than 72.36%
 
Join Date: Aug 2007
Location: Chico, California
Posts: 2,072
Bigmutha is a splendid one to beholdBigmutha is a splendid one to beholdBigmutha is a splendid one to beholdBigmutha is a splendid one to beholdBigmutha is a splendid one to beholdBigmutha is a splendid one to behold
Default

Most people use the built in timer to do timed things.
I haven't ever really learned it, but I think you use
Code:
startTimer();
to start it. And
Code:
getTimer();
to get the amount of time currently on the counter.
And by default it's in milliseconds or something.
(Don't quote me on this, I'm not great.)
__________________
02/21/2014

Take On Me - Literal Version

Quote:
[15:59] NoobSlice: I think you would be good in a porno.

[23:52] NoobSlice: ...I just want some ****ing head.
Reply With Quote
Reply

Tags
flash, game, movement, random

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Please support this website by checking out our sponsors!

All times are GMT. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2007, Crawlability, Inc.