Jump to content


Photo

Small Problems In My Break Out Game


  • Please log in to reply
44 replies to this topic

#41 the_recruiting

the_recruiting

    GMC Member

  • New Member
  • 800 posts

Posted 12 July 2009 - 10:12 AM

1. How to make the ball start ontop of the pong. (trying to do this for ages.)

What I want to know how to is make the ball follow the pong left and right?


Create Event

instance_create(x,y-7,obj_ball);

Now this creates obj_ball at the x and y coordinates as the object you put it in. Put that in the create event of your paddle object.
Next problem was how to make obj_ball follow the x coordinate as the paddle but once space is pressed, it will carry on with its normal routine.

Create Event

go = 0;


Step Event

if go = 0 {x = obj_paddle.x}
if go = 1 {//your normal obj_ball code}
if keyboard_check_pressed(vk_space)
{
go = 1;
vspeed =- 7; //replace with your up movement code.
}


All of the code above should go in the events listed in obj_ball.


Thx for the reply but Sinister95 figured it out.
  • 0

#42 Sinister95

Sinister95

    GMC Member

  • New Member
  • 313 posts

Posted 12 July 2009 - 10:16 AM

Also, you might want to explain the third question more, so people without the gmk can look at the step event of the pong, so you can get help faster :)
  • 0

#43 the_recruiting

the_recruiting

    GMC Member

  • New Member
  • 800 posts

Posted 14 July 2009 - 07:58 AM

The 3rd question isn't needed anymore thx to you Sinister95.
You have been a great help and a good mate :) thx
  • 0

#44 Sinister95

Sinister95

    GMC Member

  • New Member
  • 313 posts

Posted 14 July 2009 - 08:13 AM

Lol, ok, you're welcome. Glad to help a fellow gamemaker :)
  • 0

#45 bmc92

bmc92

    GMC Member

  • New Member
  • 24 posts

Posted 14 July 2009 - 01:18 PM

you dont need to place those objects along the bottom of the screen , just put this code into the ball's outside room event[codebox]x=xstart; y=ystart;
with (obj_pong) x=xstart; y=ystart;[/codebox]
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users