Problem Number 5

February 15, 2006 at 4:34 am (Game Maker, Uncategorized)

Make one object follow another object but they don’t touch

To get this one done, you need to make two sprites. I made two ball sprites. I edited one to have a coloured force field that would be invisible on a particular background. Then, I made two objects, object1 was the the object without the force field. It had the event [Create] with the action [set direction to random(0-360) and speed to 5]. The other event it had was [outside room] with the same action as before plus the action [move to a random position with hor snap random(640) and vert snap random(480)]. Then, with the other object (the one with the force field) I gave it the event [step] with the action [move to point ((object1).x, (object1).y) with speed 3] and also the event [collision with object1] with the action [for other object: move to a random position with hor snap random(640) and vert snap random(480)]. After all that complicated stuff, all you need to do is create a bacground, the same colour as the force field, create a room with the background and add the objects.

I used a few examples from a game me and my friend, Pikmik, created.

DONE!

screenshot5.jpg    screenshot5.2.jpg
This is the finished product, alongside an example.

Advertisements

5 Comments

  1. jrb01 said,

    Nicely done screenshots there. Very descriptive piece there, professionally done. 😉

  2. Bill Kerr said,

    explain to me how you did the force field???

    to tell you the truth I made that question easier so that now the objects are allowed to touch – you have done an extension exercise really!

  3. jrb01 said,

    Oh, so they can touch. I got told they can’t be murasame himself :p

  4. maxymous said,

    well done murasame, it’s a good description and googd screenshots!

  5. maxymous said,

    sorry about the googd thing! whoooooooooooooooooooooops!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: