Page 1 of 1

Minigolf - programming challenge

PostPosted: Thu Jan 13, 2005 3:00 am
by matthornb
I'm trying to assemble a minigolf game with Game Editor for free release on the web.

However, I can't figure out how to code a "putter".

This looks like a pretty tricky programming challenge -

How do I create a putter that can be rotated around and adjusted to hit the "ball" object at different speeds/directions?

And how do I let the player know what speed or direction will result from the hit? (Through "directional lines" and/or a strength gauge)

I'm more of a graphics person than a programmer, and I admit, I don't know how to do this.

PostPosted: Thu Jan 13, 2005 3:29 am
by jazz_e_bob
Oooh physical response - yay!

The simplest "putter" would be a filled circle following the mouse.

The circle follows the mouse and on collision with ball you do physical response on the ball only.

Easy so far. 8)

Putter with a shape different from a circle?

Then you need to have a picture of your shape at all of the angles you need. 360 angles = 360 pictures. You probably only need around 32.

Set it up so that left mouse rotates putter left and right mouse rotates putter right.

The design can easily evolve from this point...

While you are doing graphics make your strength gauge. 2 layers. A front panel with a window for the meter bar to move inside.

Programming the meter is a little tricky. There is a good example in the Moon Defender demo.

Speed and direction arrows can be done with the drawing functions which is not my area of expertise.

Have fun. Looking forward to playing!

:)

PostPosted: Sat Jan 15, 2005 12:08 am
by matthornb
Set it up so that left mouse rotates putter left and right mouse rotates putter right.


I've assembled the circle of sprites for the putter at different angles, but have yet to figure out a useable "rotation" technique.

I'm currently trying to set left and right buttons to change the "angle" while pressed.

Then I set up the "draw actor"event with a script that checks the "angle" and changes the animation (putter1, putter2, etc.) associated with that range of angle degrees..

However, for whatever reason, pressing the left and right buttons in game mode does nothing.

I'm confused.

PostPosted: Sat Jan 15, 2005 7:01 am
by jazz_e_bob
I made a quick and nasty demo for your perusal.

http://www.maybanana.com/pantzboi/game_editor/minigolf%20demo.zip