Are Iphone D-Pad controls available for jump and shoot?
butterbean
Member Posts: 4,315
I was looking at the Wiki for mapping iphone D-Pad controls, is there a customizable D-Pad that you can also add a jump AND shoot button to at this moment?
Sorry if this topic has been covered before
Sorry if this topic has been covered before
Comments
They are just mapped to the arrow keys and the space bar. Its an ALL or NONE situation. You can always just make your own buttons using actors.
What he is saying by it's all or nothing, he is referring to the Scene Attribute titled "Uses Direction Pad" which means that by default there will be a D-pad on your scene, that uses all the directional keys, you can't disable certain ones, without going in and just making your own rules/buttons. To use the "Uses Keyboard" on individual actors, you just slap an overall rule on the actor that says "when Uses D-Pad is true..etc"
This makes it transparent(ish) depending on what you put in (.25, .5, .75 etc) and mimics the way the standard GameSalad d-pad buttons appear.
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
So you just place those within the actor?
If people are customizing their own keys, how are people creating the actors for those and how they appear?
Also, with the one already included in gamesalad, is it possible to add another, say shoot key, in addition to the ones already provided, or do you have to do it from scratch?
Firstly, you'll need to define some variable for the movement you want in the Attributes window.
These are boolean variables, and are set to false (don't use the checkbox in other words!).
I've got MoveLeft for left movement, MoveRight for right movement etc.
Ok, look at the link for a pic of the rules for one of my buttons, 'Move Left':
http://quantumipod.googlepages.com/MoveLeft.png
(please note, I have not created images for the buttons yet, which is why they appear just as 'boxes').
As can see, two things happen when you press the buttton:
1. The variable game.MoveLeft is set to true
2. The button's alpha is set to .25
The otherwise section means that when the button isn't pressed:
1. The variable game.MoveLeft is set to false
2. The button's alpha is set to .1
As a side note, the changing alpha values essentially make the user see it 'light' up when pressed - useful feedback!
Now, on my ship Actor, this is how the movement works:
http://quantumipod.googlepages.com/ShipMovement.png
You can see that when the attribute game.MoveLeft is true, then it will move the ship to the left.
(I've included the 'actor receives event - key - left as well for my own testing purposes).
That should work.
You cannot add another button, e.g. 'jump key' in the default d-pad - it's simply up, down, left, right and shoot.
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
So I should create a boolean attribute for each of the movements, move left, move right etc, and also, keep the keyboard movements in the actor for testing purposes on the computer as well right?
Thanks Quantum!
i have three actors that each represent a touch button in my DRFT game. its left, right, and gas.
now what? because honestly, how do i map those button presses to controlling my car actor? i bet i know how to do it, but maybe someone had a better idea.
The by using the D-Pad you have multi-touch available. So one issue if you try making your own buttons to do something like
Rule: If mouse button down, and mouse position over actor,
-- Change Attribute: game.IAmPressingButton1 = true
Otherwise:
-- Change Attribute: game.IAmPressingButton1 = false
and do that for each button you make (and giving each button their own game attribute), then you lose your multi-touch ability for drifting. At least until we add multi-touch ability to GS.
Though if it were enabled, you could make your different buttons and set your car to check those game attributes(game.IAmPressingButton1, game.IAmPressingButton2,etc.) if they were true instead of looking for key presses(left, right, space)
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Hope that's clear!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
That would be a pity - I really like DRFT
"should make it so we can edit the d-pad. add/remove buttons. change images. that would be awesome."
Indeed.
There should be two defaults - one for horizontal games (as seen right now) and one for vertical games.
Then let us copy a button and add a different function to it - e.g. copy the fire button, but change it so that it becomes the jump button.
It's just one less thing we have to worry about when making games - having automatic buttons really helps
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io