Started a game in Game Make need help fixing a cannon

Discussion in 'Indie Basics' started by SuperMonkey2113, Dec 8, 2016.

  1. SuperMonkey2113

    SuperMonkey2113 New Member

    Joined:
    Dec 8, 2016
    Messages:
    1
    Likes Received:
    0
    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;
       }
    }
    
     
  2. Rocket35

    Rocket35 New Member

    Joined:
    Jan 8, 2017
    Messages:
    4
    Likes Received:
    0
    Did you get any error messages?
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer