I thought I'd be stepping into the realm of physics with my next idea after Tower Defense because I wanna look at making one of those 'see how far you can throw this' kind of games and I figured hmm probably need to do the 'physics stuff'... I don't know it so well so its a great opportunity for me to learn it all..
A couple of examples would be 'Toss the Turtle' and 'Kitten Cannon', but I found out last night that I hadn't actually played Turtle since 2010... I don't know how I didn't know this, it felt so fresh in my mind! Anyway the relevant discovery is your 'player', your 'turtle' never moves beyond a certain X position...... It has a bounce (Gravity??) and then a rotation speed I guess just to give it the look and feel of motion.. I would think Animations would help here too...
So what this means is 'everything else' moves left instead of your player... Do I still need to mess around with physics? I'm still using Game Maker Studio for now.. I want to check out Unity and it seems their personal license is plenty fine but for now I'm in GML still... Whilst in GM, I was able to have a background 'tiled horizontally' "Scroll" indefinitely at a set speed.... Progress. Not the hardest thing to achieve...
I then made it 'slow down' on command, 'spacebar', if I command it again, it'll speed up again, so its a switch.. I feel like this would be the best method for the entire world to move and have things slow down.. If you were to hit an explosive or a spring or a 'boost' type object then you can switch off the 'slowdown' or reverse it so you're controlling the speed up.. whichever works best. And then after a second or two turn it to slow down again... Ultimately coming to a stop.
That was another thing too, getting it to cap the speed, wasn't too tough, I just gotta figure out what's too quick and then 'too slow' wouldn't matter because 0 is stop, it doesn't need to go in reverse........ Or does it hmmm I dunno if that would ever be a thing, The general idea is that it slows down and stops...
I made my 'player' bounce but maybe not in the best way possible, I used another switch 'fall' so if you are falling you are increasing you Y by bounceSpeed until a certain point, that certain point is the floor, when you hit the floor are NOT falling and you would decrease Y by bounceSpeed until you hit bounceHeight, then you would fall, But this just moves between the floor and a 'roof' ... So it would need to decrease everytime you 'bounce'.. I added in bounceHeight -= 200; which activates everytime you turn off falling... so ultimately you stop bouncing... That works too...
Still not using the built in physics and I've got the fundamental mechanic to the game (I think)... The only thing I need to figure out really is how to make your bounceSpeed, bounceHeight and backgroundSpeed all connect to each other... This is where I end up thinking I need physics... but I don't know. I believe in physics its no longer about x+= 5 but in fact you'd exert a force of '5' onto your object from a certain side which would make it react... gravity would just pull it down, forever, ??? So I'm not sure if I'm just as obsessed with Physics as David Tenant in Doctor Who or if I actually need to use it.....................
'States'
I don't fully understand how this would work but I think I would need to make a few 'states' in the game... and have it built like a giant switch statement?? I still wanna use these...somehow
But yeah, I was thinking, The start of your game is going to be State 1, 'IDLE'... This state has 'nothing' happening although a lot might be happening it just looks like nothing is happening.. until you click 'throw' 'launch' 'fire' etc (Unless you have a gauge and allow the player to adjust the power of the throw.... I dunno.. but until you 'fire' basically)
Then state 2 would be quite small, basic, short, whichever word... Because you'd need to 'start' the whole everything scrolls but your character/turtle/kitten doesn't just appear at position X, you go from your launcher to that position... and you need to move your launcher to the left a little bit (I was thinking destroy the launcher BUT if you do a really poor throw and land right next to your launcher,, even if you move a little bit.. It might still need to be visible so Destroy is NOT an option).. Once you've hit position X you clamp it, lock it, stop it, whatever its called and you'd want to switch to state 3.
State 3 is what I called Falling BUT maybe it'd be better to call it Flying... you might have some more momentum and still be flying through the clouds at this bit.... THEN falling... so State 4 would be Falling... switching between State 3 and State 4 if you hit boost items? For a certain time like 2 seconds?
State 5 is so close to State 1 but you'd want to calculate your score and and save your furthest distance and stuff like that... Then switch to State 1, and you're in a loop........ but does that even make sense and does that even work...... ? ....
States 1, 2 and 5 are fine, I can sort those out... Its just the Flying and Falling... switching between could be really easy, like change a few true and false and its switching... conditionally of course... Now would I even need to consider use of Physics for State 2 and State 3 ? I mean flying, you're going to move upwards 'lower' on the Y (I'm sorry I just gotta stop there.. This is really confusing to me because although you're going 'up' you actually going 'down' in terms of the value of Y -.- like 0 is the top, so to go up you need to decrease Y... legit Y is that a thing??? anyway.. )
This is not a top down game either so I'm not so sure how things would work in terms of setting the direction... Left is still angle 0 ... up is 90, down is 270, Would most likely need to set a range within 90 - 0 - 270 so you can't 'go backwards' either... I think that would be fairly 'easy' to maintain though.. This would also need to decrease along with the bounce/y position but perhaps not completely increase after a bounce...
I don't know... It's going to be super fun to figure out. And I'm sure some people can say "This is well easy dude! What the flip are you on about??" I'm hoping I can be as smart of those people some day and just know what everything does BUT y'all have to admit.. its a lot less fun 'now' when you can 'just' make stuff... Like to me, the fun part is the learning part. Once i'm a professional, I'd need to find fun through making crazy chaotic things happen ! I dunno.. Future stuff...
I just read the first half, and skimmed the second.. You may want to explore the physics option a little more.. Don't be intimidated.
It's a little bit of a learning curve, but it will really reduce the frustration you're having with the "movement" of the thrown object.
To throw it, you'll just add a force of some magnitude(number) to the object in some direction (x,y) vector. A vector is essentially just a line that goes from 0,0 to whatever your specified x,y is(relative to whatever you're applying the force to, i.e. the thrown object is always the 0,0 part of the vector you're using for the force). A vector and a point are represented the same, so it's confusing.
e.g. if the object is @ 1,1 and you add a physics force with a vector of (1,0) it will cause the object to move to the right at the speed of the (force magnitude) you applied. A vector of (1,0.2) will give it a slight upward direction, but gravity will take over from there and bring it back down slowly, based on how much magnitude you give the force.
To handle the bounce and the slowdown, you can adjust the "bounciness" and "friction" of the object, and the objects it comes into contact with(ground,obstacles,etc.). I'm assuming that GameMaker has physics materials as well. These are materials that allow you to specify the bounciness or the friction that the object will have/create with other objects when they collide. You should be able to assign these attributes (bounciness, and friction) in some way as they are key to using game physics, so if it's not physics materials that you apply to an object, then it will be somewhere else in there.
I would also rethink the moving of the whole world instead of the "thrown object". It'll be hard to get physics working right the other way. Just focus your "camera" or your "view" on the X(if x is left-right) position of the thrown object and whatever Y you like. That way it always follows the thrown object and that's the only object you need to worry about moving or adding physics forces to. Everything else should work the same, essentially.
Yeah, a simple state machine could be made with a variable to track the current "state" and a switch-case inside a main loop to "do something" when the state changes. That's a pretty straight forward way to make it work.
Also, yeah, Unity is good to go for anybody who doesn't make more than $100,000 a year off of their games. It's fully capable and the very few Pro-only features they have are gonna be things you'll likely never need.