View Full Version : [AS3] Mini golf game
chico83
03-03-2009, 01:54 PM
Hi, I'm in the middle of creating a basic mini golf game. Having designed the interface it's now time to do some programming. However, having never used ActionScript before I'm struggling with the implementation.
I need the ball to move forward a certain distance depending on how long the mouse has been clicked and in the direction the mouse pointer is facing.
Basically I don't know where to start, so if anyone could point me in the right direction that would be great, thanks! :D
aaron_da_killa
03-04-2009, 12:36 AM
I've never used ActionScript before last month or so ago and I got straight into it by making a game too so believe me I know how daunting it can be.
I kind of dislike it when I ask a person a question and they link me to something that will take a long time to read but I strongly suggest you go here (http://edutechwiki.unige.ch/en/AS3_Tutorials_Novice) and do the tutorials in order. A basic understanding of action script is absolutely essential for you to be able to start figuring out things for yourself. Kind of like that saying you have to have money to make money.
I got up to the AS3 example Positioning tutorial than skipped to the Keyboard tutorial before I found a platform game from scratch tutorial that I reffed to closely, after using some code from that tutorial I quickly moved away from that and started writing my own code and eventrully rewrote the code that I copied from the tutorial, using an internet search and this place (actionscript.org forums- very helpful believe me) if I ever needed some help.
Just hang in there, don't over stress yourself and the rewards will soon pay off.
To be honest, I think a golf game (I'm assuming mini golf) will be pretty easy, the most difficult thing will certainly be the ball physics when it rebounds off the walls and rolls down hills and such but I certainly have an idea of how I would go about it.
As for your original question, I would make it so that when the player clicks the mouse, the distance of how far the golf stick is driven back is measured and the ball's movement speed is made according to that.
chico83
03-11-2009, 05:31 PM
I've never used ActionScript before last month or so ago and I got straight into it by making a game too so believe me I know how daunting it can be.
I kind of dislike it when I ask a person a question and they link me to something that will take a long time to read but I strongly suggest you go here (http://edutechwiki.unige.ch/en/AS3_Tutorials_Novice) and do the tutorials in order. A basic understanding of action script is absolutely essential for you to be able to start figuring out things for yourself. Kind of like that saying you have to have money to make money.
I got up to the AS3 example Positioning tutorial than skipped to the Keyboard tutorial before I found a platform game from scratch tutorial that I reffed to closely, after using some code from that tutorial I quickly moved away from that and started writing my own code and eventrully rewrote the code that I copied from the tutorial, using an internet search and this place (actionscript.org forums- very helpful believe me) if I ever needed some help.
Just hang in there, don't over stress yourself and the rewards will soon pay off.
To be honest, I think a golf game (I'm assuming mini golf) will be pretty easy, the most difficult thing will certainly be the ball physics when it rebounds off the walls and rolls down hills and such but I certainly have an idea of how I would go about it.
As for your original question, I would make it so that when the player clicks the mouse, the distance of how far the golf stick is driven back is measured and the ball's movement speed is made according to that.
Thanks for the reply, I did consider your method for hitting the ball but thought it would be much harder to implement. However I'm still stuck with the mouse input for the golf ball and so was wondering if you or anyone else could help me with the code for that. I kinda figured I'd have to use a mouse event listener although I'm not too sure. TIA :)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.