Jump to content


scranner

Member Since 03 Mar 2012
Offline Last Active Mar 04 2012 11:41 PM

Posts I've Made

In Topic: Timers

04 March 2012 - 04:50 PM

yes just put this in the pressed button whatever event:

instance_change(obj_longer,true)
alarm[0] =150
Alarm 0 event:
instance_change(obj_normal,true)

now for this how does the time frame of the array alarm[0] work. is 150 150 seconds?

In Topic: Need Some Help

04 March 2012 - 01:14 AM

Give the ball a variable and then in the space event set it to false. Now, while it is true, have a step event that says "if variable is true then x=bat.x and y=bat.y-sprite_height"... or something similar. If you need more precise instructions then let me know!

yes could you give me a little more detail please?

In Topic: Need Some Help

04 March 2012 - 12:44 AM

on button press
if (keyboard_check(vk_space))
{
    if (obj_ball_normal.speed == 0)
    {
        motion_set(80,12);
    }
}
else if (keyboard_check(vk_left)) 
{
    if (obj_ball_normal.speed == 0)
    {
        obj_ball_normal x -= 1;
    }
}
    else if (keyboard_check(vk_right)) 
{
    if (obj_ball_normal.speed == 0)
    {
        obj_ball_normal x += 1;
    }
}

on button release
if (keyboard_check(vk_space))
{
    if (obj_ball_normal.speed != 0)  motion_set(0,0);
}

this is the code i am trying at the moment any ideas to why it dosent work. currently the ball just continues to go left to right and so on

In Topic: Need Some Help

03 March 2012 - 11:13 PM

A Breakout type game is fairly simple - it is just a matter of getting the math right so there are no gaps when you place the blocks. Blocks of a uniform size when hit by "something" get destroyed and score awarded.

The space bar firing is not a problem.
Key Event for Space Pressed
:GM057: Check Instance Number
<select ball object>
Value: 0
<select Equal to>
:GM063:
Add the fire ball action here
:GM066:

In essence it means, when the space key is pressed a check is made to see how many balls exist (we only need one) and only if it equals zero do we need to fire one, otherwise we do nothing and pressing space would have had no effect.

The boundary of the game (where the ball cannot go) you fill with wall objects. When the ball collides with these it is bounced off (not precisely so it bounces at angles) :GM016:

Does that give you enough to get started?


i think you have misunderstood me with is my fault. the ball will already exist at the beginning. i want the player to be able to to move left or right and the ball to move with the pad then when the spacebar is pressed the ball to fly off and the game to begin