Collisions between objects and random movement. - Forum

Forum Navigation
You need to log in to create posts and topics.

Collisions between objects and random movement.

Sometimes I stop to think and say: How far can I go with VisualNeo Win?

Now I have come up with a new game but I need to do two things to make it work.

- One is that when two objects of a certain type collide (they are images that move), one of them disappears.
(Right now what I do to know if they have collided is to register the position in Top and Left of each one in a loop, and when they coincide I make one of them disappear. But I don't know if there is a better way to do this).

- The other is if it is possible to assign to the MoveObjectAlongPath command random directions or to move randomly or near a given point.

The aim of the game is to create two objects, and have them move randomly around a stipulated area, and if they are close, one goes to the position of the other.

Maybe it's too much to ask, but I have to see how far VisualNeo Win can go.

Best regards, and thanks, as always.

@lemachinga

Take a look at these two demo projects by Peter Pavlov, perhaps he can help.
In the first project, the image of the moon moves inside the main window, repulsed by its sides. In the second, the Earth also flies in the same way.

Generating random trajectories (including around a given point) is possible. To do this, you can always substitute random values within a given range in the parameters of the MoveObjectAlongPath command.

Uploaded files:
  • You need to login to have access to uploads.
LeMachinga has reacted to this post.
LeMachinga