Help! I have no idea of how to work Game Maker!

Status
Not open for further replies.

Jurai_Madman

Ich bin der Verrucktmann
I am starting a Game Maker project, a Pong game where Sonic is the ball. I got the idea from Death Egg Act 1, from S3&K, where you have to hit the six buttons to progress to the next area in a wind tunnel type thing. I need some help trying to get an AI for it.
 
There've been topics like this before. Just look at the onsite tutorials and the help file that comes with the program. It's not that hard to figure out.
 
I am trying to figure out how to make an AI worthy of a Pong type game, and I do not know what actions to use for the creation event.
 
Jurai_Madman said:
I need to figure out how to set up controls.
I usually use "Key press <Insert key you want to move right with here>" and the action will be move right the event "key release <insert previous key here>" and set the ball to a stop.
 
Jurai_Madman said:
I am trying to figure out how to make an AI worthy of a Pong type game, and I do not know what actions to use for the creation event.
You could do this. Make your opponent object follow the ball's X position ( or Y, depends on the way you place the objects ).

On the step event, put a "PERFORM A STEP TOWARDS POSITION" action. In the XY varibles, put x.ball on the x variable, then put y on the y variable. Speed should be the normal speed of both PONG sticks. Then "stop at solid only." That should work.
 
If the ball's Y is higher than the CPU paddle's Y, the CPU moves up.
If the ball's Y is lower than the CPU paddle's Y, the CPU moves down.
If it's neither, the CPU stays put. Granted, this is unlikely due to the nature of Cartesian coordinates (in layman's terms, the usual 2-axis graph), but it's important that it doesn't move, either way.

Honestly, it doesn't need to be more complex than that - and let's face it, that's what all humans would do, as well.
 
Actually, a more complex AI would predict the ball's path using trigonometry and position itself in the spot where it would reach the paddle. For example, the ball would bounce off the top side wall and travel to the bottom right - the CPU would know to move to the bottom rather than blindly follow the ball and move up. However, what Shadow Hog suggested is much simpler, and is adequate for most situations. It's also good practice for learning game logic. Once you're familiar with game logic, you'll be able to tackle just about any game development tool or programming language. Provided, of course, that you will learn their syntax, but the basic principles will remain the same.
 
FoxBlitzz said:
Actually, a more complex AI would predict the ball's path using trigonometry and position itself in the spot where it would reach the paddle. For example, the ball would bounce off the top side wall and travel to the bottom right - the CPU would know to move to the bottom rather than blindly follow the ball and move up. However, what Shadow Hog suggested is much simpler, and is adequate for most situations. It's also good practice for learning game logic. Once you're familiar with game logic, you'll be able to tackle just about any game development tool or programming language. Provided, of course, that you will learn their syntax, but the basic principles will remain the same.

True! Once you got the game logic. All you need to know the code. Thats how it works for me.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top