1. This forum is in read-only mode.

naruto pong

Discussion in 'Computers & Modding' started by kingofgamemasters777, Jun 19, 2008.

  1. kingofgamemasters777

    kingofgamemasters777 Well-Known Member

    im making a pong like game with gamemaker 7 but i cant figer out how to make the other paddle move to the ball by itself ???
     
  2. flashx_454

    flashx_454 Well-Known Member

    Re: help with gamemaker

    Both Codes are for A.I.
    put this in the end step of the computer controlled paddle

    Code:
    //These prevent the opponent to go through walls.
    if (y<other.y) //If above the colliding object when colliding,
    {
    y=other.y-64; //Move to -64 above the other object.
    }
    
    if (y>other.y) //If below the colliding object when colliding,
    {
    y=other.y+64; //Move to +64 below the other object.
    }
    hope that helps :)

    and this in the collision with wall
    Code:
    //These prevent the opponent to go through walls.
    if (y<other.y) //If above the colliding object when colliding,
    {
    y=other.y-64; //Move to -64 above the other object.
    }
    
    if (y>other.y) //If below the colliding object when colliding,
    {
    y=other.y+64; //Move to +64 below the other object.
    }
     
  3. kingofgamemasters777

    kingofgamemasters777 Well-Known Member

    Re: help with gamemaker

    thanks, i need more detailed instruction, how do i put the first code in The end step of the computer controlled paddle, and how do i make a computer controlled paddle, and how do i put the second code in? (i never did a game needing computer control) oh and also did you mean wall or ball
     
  4. flashx_454

    flashx_454 Well-Known Member

    Re: help with gamemaker

    first of all how long have you been using GM
    secondly go into the object properties for the second paddle and click add event then step then choose end step
    then add the code by click on the control tab and the add code button paste in the code and click the checkmark
    thirdly add the second code in the collision step of the paddle with the wall.​
    hope that helps :)
     
  5. anandjones

    anandjones Well-Known Member

    Re: help with gamemaker

    Also, using GML (the language), you can use advanced features for Follow movement of Sprite.
     
  6. Pepperpost

    Pepperpost New Member

    Re: help with gamemaker

    does anybody know how to make a character shoot 1 way and shift to the other side.. o_o and make jumping easy....
    never mind that D:
     
  7. kingofgamemasters777

    kingofgamemasters777 Well-Known Member

    naruto pong complete

    well its done download it here thanks for all those who helped. pleas post your comment on what you thank of the game