# Great Gamer

Member Since 04 Jun 2012
Offline Last Active May 19 2013 10:21 PM

### Test For A Collision Between Point A And Point B

26 February 2013 - 08:09 AM

Hello. I am wondering how to test for a collision with a specific object between point A and point B. Say you want a computer player to shoot his gun if he is close enough to another object, but that object can be found at any Y(as it has no gravity). Normally, you would use
```if distance_to_object(object) < 64
{
instance_create(x,y,obj_bullet)
if place_free(x,y+1)
{
move_contact_solid(direction,-1)
vspeed = 0
}
}
```
but that would cause him to jump even if the other object is at the same Y as him. You would want to check if the computer player's Y is the same as the other object, but the X is less than 64 away from it. But you can't check the other object by using other.x or other.y since it's not involved in a collision. How would I check to make sure if there is a specified object at the same Y but less than 64 X away?

### Having trouble making an object appear randomly

12 December 2012 - 09:52 PM

I'm trying to make one of 2 objects appear randomly if the amount of instances of the randomly chosen object is less than 3. But they don't appear at all. Can you find where I'm going wrong?
```objecttocreate = random(100)
if objecttocreate = 0
{
if instance_number(object2) < 3
instance_create(607,random(448),object2)
}
if objecttocreate = 1
{
if instance_number(object3) < 3
instance_create(607,random(448),object3)
}
```

### The Trio - The Saviors of Mankind

15 June 2012 - 12:51 AM

This game, when complete, will have 14 levels. I don't know if I will ever complete it, but maybe eventually I will. Maybe if there are enough people liking this game, I will finish it sooner.

There are 3 people, Balloon, Man, and Mad Rock, that try to stop a villain from ruling the world. Use their abilities to overcome obstacles and save mankind as we know it.

File Size: 30.3 MB
GM Version: GM8.1
Vista Compatible: Does Windows 7 count? If so, yes.
Changes Screen Resolution: no, I think.