GameMaker: Studio

GameMaker: Studio

Oyunları kolaylıkla bulun, oynayın ve yapın
GameMaker: Studio'da, ücretsiz bir şekilde, oyucular tarafından yapılan en iyi oyunları keşfedin, oylayın ve indirin. Veya kendi oyununuzu yapıp topluluk ile paylaşmayı deneyin. Daha fazlasını öğrenmek için buraya tıklayın.
Help please
I am trying to make one of those "brick breaker" syle games where you move a paddle around at the bottom of the screen and the ball bounces around destroying bricks. However, I can't figure out how to prevent the paddle from being able to leave the playing area. Please offer any suggestions.
< >
9 yorumdan 1 ile 9 arası gösteriliyor
You could set the paddle object to wrap around the playing area, either manually by changing it's x and y coordinates, or by using this Method in GML.

move_wrap(room_width,room_height,64)

This goes in the step event. ;D
Thank you so much, that worked perfectly. I also have a problem with moving the ball. I set a "release space" event to move the ball in a random direction at a defined speed, but I would like to limit the user to only be able to use that once and not cheat during gameplay and avoid the bottom.
You can create a variable that will do this.
If this release space event is on the ball itself, try this...

Create event: released = false
Top of release space event: if (released == true) break
Bottom of release space event: released = true

This will create a bool, "released", that is set to false when the ball appears, and then set to true when the ball is in fact released. It won't be released if it is already true.
I keep trying to use that but i keep getting an error "break used without context"
Try "exit" instead of "break"! If you are using Drag and Drop instead of code, that might be the issue. PS: exit will not exit your game

Please let me know if you are using DnD or if it still doesn't work in code
The Coding Tutorial included with the program teaches you how to make a brick breaker game. You can have a look at that.
Ha, I never used the tutorial, thanks.
Or iif using drag and drop just drag in 'Move to colision' and leave it there job done.
Put this in the step event of the paddle object.

if (x>0)
{x-=4}
if (x<room_width)
{x+=4}
< >
9 yorumdan 1 ile 9 arası gösteriliyor
Sayfa başına: 1530 50