Looking for a sling shot action for a golf game – Anyone know of tutorial?
Village Idiot
Member, PRO Posts: 486
Hi Y'all. I'm attempting to make a golf type game where the player drags back from the ball to generate the shot strength and direction. Does anyone know of a tutorial or template? Any help would be greatly appreciated.
I found this: http://gshelper.com/product/pro-golf-18-hole-ipad-template-art-included/
It has the action I'm looking for – I'm guessing it's quite old, would it be ok? Or does anyone know of anything better?
Comments
no-one knows of a tutorial?
GameSalad comes preloaded with Big Top Blaster (at least on Mac) which is basically what you want, with a few modifications.
You control a cannon by dragging your finger - the further away from the cannon the more power it has, and the 'height' of the touch point controls the trajectory.
That would be a good starting point.
Thanks – Just checked it out.. and that is the sort of action I'm looking for. Do you know of any tutorials?
Found this in Google - too long for me to go through but looks like the rules will be in there:
BUT, the rules and behaviours are REALLY well commented in the Big Top Blaster - you'll probably be able to work out how it's all working just by looking through the project
Thanks heaps Mike.. I found this too, but thought it might be too old. I'll go through it anyway, as there seems to be nothing else. I didn't realise that Big Top Blaster was commented. I'll go through that as well.
The tutorial above is old, but it also doesn't really use a sling shot method it's more of a gun shot. Even though it's old all of the behaviors and actions should still work fine.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Oh balls, you're absolutely right @jamie_c.
Still, the Big Top Blaster is still a good starting point
Here's an old project, might be useful, click and drag on the screen . . .
P.S . . .
"the player drags back from the ball to generate the shot strength and direction"
The process is easy enough.
1) when mouse button is down, or touch is pressed - then record mouse X and Y
2) when mouse is released calculate vectorToAngle and magnitude using the current mouse X and Y and the recorded X and Y.
3) send the ball off in the direction given by the angle calculation - and at the speed given by the magnitude calculation.
4) Done !
thanks @Socks – I like the name of the file. New colour for your cube – a change is as good as a holiday
I don't know if you remember all of my inane questions that I've posted here over the past couple or few years now.. but they've come to fruition and my game – that I've been working on all this time is actually finished, has a trailer and is approved by Apple! Soon I will make it known within the realm of my fellow GS people and we can all sigh together!
I think I should do that tutorial that's up on GS help about getting to know and love the expression editor – because I STILL find all of that stuff that you seem to comprehend so naturally, to be mind frying.
Hi again. I've got this template called Golf Pro and I'm trying to work out how it works with my pea brain. I've noticed this thing which spins around the golf ball anti clockwise once you click then drag in order to make a shot. I've looked inside the actor which makes this circle but can't understand what makes it spin – and in that direction. I know angular velocity determines the speed at which it turns, but the direction? Can someone please help?
Is the actor on the scene unlocked with other behaviours?
no, it gets spawned
have uploaded the template..
you'll find another circle actor which I can't work out what it's doing
Angular Velocity.
The Angular Velocity is set to 100, which is 100°/sec CCW.
@Socks I can't see where it's stating CCW. I've attached a grab of where I'm looking. As far as I can determine, there's nowhere else to look as the actor is spawned and there's no instance of it on the scene.
In the world of maths angles increase counterclockwise.
oh.. Thanks @Socks I was never good at maths.. nice flashy arrow. Just think of me as the mentally challenged one sitting in the corner drooling.
although, I suspect by now, you already do..
PS: I noticed that your cube was this colour years ago. You got sick of the green?
@Socks I think I'm going to have to look this stuff up. Do you know of any sites that might explain this for remedial types like me?
I didn't change it, the colour is decided by a team of wizards, they email me a new cube every 314.159 days.
Just ask here, at the least you'll get an explanation that relates to GameSalad.
All this stuff is pretty straightforward, a bit of experimentation will - very quickly - show you what Angular velocity is doing, the value field is how many degrees the actor rotates in 1 second, if you changed it to 50 it would have slowed down, change it to 2000 and it goes much much faster, change it to -200 and now it's rotating at minus 200°/sec, which is CW . . . etc etc . . .
I personally know all this secret esoteric knowledge because when I was in the same situation I pressed a load of buttons, and tried a bunch of values and took a look at what happened, I could see that 360 made the actor do a complete rotation in 1 second, a value of 36 made the actor do a complete rotation in 10 seconds . . . so I concluded that was how the speed value must be set up - as degrees/sec - it took a couple of minutes or so to arrive at that idea . . . that is to say there is no special math skills required here !!
I can't imagine you ever being anywhere near my subterranean level. I just tried putting a minus sign in front of the value and it spun the other way.. and it made me smile a nerdy smile .
Why would they use angular velocity instead of something like a rotate behaviour? Is it just a case of preference? Or does it improve performance?
Thanks again @Socks for your sage like wisdom.
See what joys a little experimentation will bring !
They are doing pretty much the same thing, no performance difference. The Rotate behaviour lets you control the speed value with an expression, whereas just typing the value into the Angular velocity attribute field saves you a behaviour . . . so not really much in it.
Crosses legs, hears a cracking sound, backs out of the whole crossing legs thing.
I built a system using the power meter method like many of the old golf games had.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@The_Gamesalad_Guru Do join have a tutorial on this?