Advertisement

Need help RE Game Maker

Started by December 08, 2016 04:04 PM
-1 comments, last by SuperMonkey2113 8 years ago

Okay I'm new to this so I apologize for any dumb questions I may ask.

So what I am trying to do is create an object for loading create another object to shoot and create the actual ball object.

I already created the cannon that shoots the object. Now what I want to do is create a loading object that I can put the ball in the loading object and have the cannon shoot.

(base)+(Ammunition) = Cannon shooting ammunition from another location

In my Cannon i created this
create

Code:
j=-1;
can_join=true;
cool_time=room_speed/2;
ball=noone;
p=600;

alarm 0

Code:
physics_joint_delete(j);
j=-1;
with (ball){
phy_rotation=other.image_angle*-1
physics_apply_local_impulse(0,0,other.p,0);
}
can_join=false;
alarm[1]=cool_time;

alarm 1

Code:
can_join=true;

step

Code:
if instance_exists(obj_S2){
if place_meeting(x,y,obj_S2) and j=-1 and can_join=true{
obj_S2.phy_position_x=x;
obj_S2.phy_position_y=y;
obj_S2.phy_angular_velocity=0;
j=physics_joint_revolute_create(id,obj_S2,x,y,0,0,0,0,0,0,0);
ball=obj_S2;
alarm[0]=room_speed*2;
}
}

This topic is closed to new replies.

Advertisement