Speed-Pedal
MarcoCol
Member, PRO Posts: 279
Hi,
I want to add in my driving game a speed pedal.
I add something, but currently the player can only choose the upper or lower half of the pedal to drive forward or back. That works good, but I now see, that most of the players want to move the pedal forward or back. There should be only 2 values: forward =0 or 1, back = 0 or 1
My first thinking was to move an actor only in Y in antoher area, and when overlap/touching two other other areas (one high and one lower) then the value change.
But is there an easier methode?
Cheers, Marco
I want to add in my driving game a speed pedal.
I add something, but currently the player can only choose the upper or lower half of the pedal to drive forward or back. That works good, but I now see, that most of the players want to move the pedal forward or back. There should be only 2 values: forward =0 or 1, back = 0 or 1
My first thinking was to move an actor only in Y in antoher area, and when overlap/touching two other other areas (one high and one lower) then the value change.
But is there an easier methode?
Cheers, Marco
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The player should slide them. From middle to top or down. or directly from top to down and down to up.
And the values only should be:
forward=1 / back=0 (for driving forward)
forward=0 / back=0 (for stand)
forward=0 / back=1 (for driving backward)
You'd just change the image based on the swipe (if the image is "bottom" and they swipe up, change the image to "middle". If the image is "middle" and they swipe up, change the image to "top", etc.).
Or... if you want a really simple method, just do:
When touch is pressed AND game.mouse.position.Y [is between the middle and bottom edge of the actor] --> change image to "bottom" etc...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Cheers
I've tried now a lot of and I can say, that without the middle positions, it works without problems and good as it should.
But I can't get it working, with the middle-step.
I put everything in one actor (but I should, that's not the problem).
I tried that without graphics, only with text feedbacks...
Then the main touching-rule in the actor, which works is:
Direction = 0
If Touch is released AND Release > Touch
change att Direction to 1
If Touch is released AND Release < Touch
change att Direction to 2
Which doesn't work is:
If Touch is released AND Release > Touch AND Direction = 2
change att Direction to 0
If Touch is released AND Release < Touch AND Direction = 1
change att Direction to 0
Where is my error?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I have those three attributes.
Then the big one are the four rules. The middle both are turned of for a test, but when I switch them on, it doesn't work.
Then the main functions. I set both mouse to Y - not to X as in the video example.
and the three feedbacks - when they run, I can change them with graphics...
I'm not sure what the problem is that you're experiencing. If you'd like, you can .zip the project file and send me a link to download it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I switch the both rules to "on" where the player switch from 1 to 0 and from 2 to 0.
But nothing changes.
I can switch from standard (0) to 1 (up) or 2 (down). After then, the switch is directly again from 1 to 2 or 2 to 1 - without stopping at 0 (middle). But my rules say that it must go from 1 to 0, from 0 to 1or2 and from 2 to 0.
I didn't know whay it doesn't work.
It's a very huge project, I can't mail/zip.
I add in each rule (after changing the gear.direction) the change att of the touch and release pedal to 0.
I thought it was set automatically, but that wasn't done. So it works now!
Thanks Tatiang!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
two weeks ago, I solve the main problem and it works find.
So this pedal is for get speed for forward or back.
So there are two more buttons on the HUD for drive left and right.
If I touch one of them with one finger of my right hand, then want to drive forward (so I touch with the finger of my left hand down of the pedal, move up and release), then the pedal moves down (not up!) and the actor moves back. Same when I move the finger down, then the actor moves forward and the pedal moves up (not down)!.
It works fine, if I don't touch the right/left actor, or when I touch the right/left actor after start driving forward/back.
Did you have an idea?
If I for example start with left finger on about Y30 and release at about Y80, then, nothing happens. No move forward or back!