Are Iphone D-Pad controls available for jump and shoot?

butterbeanbutterbean Member Posts: 4,315
edited November -1 in Working with GS (Mac)
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 :)

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Updated http://gamesalad.com/wiki/game_attributes

    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.
  • butterbeanbutterbean Member Posts: 4,315
    Is there a tutorial on how to make your own buttons?
  • MillerEPMillerEP Member Posts: 22
    To create your own buttons, just place an actor with a rule that says "When keyboard button (button) is down, move (direction) at (speed)" and place it where you want on the scene. if you want it to be a mouse button than add a rule with both "if mouse position is over actor" and "when mouse position is down" "move (direction) at (speed) If you want the appearance of an arrow or keyboard button just slap a picture on it and throw it in scene. Same as with all 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"
  • quantumsheepquantumsheep Member Posts: 8,188
    One useful tip is to make the alpha of your buttons less than one.

    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

  • butterbeanbutterbean Member Posts: 4,315
    So to make my own D-Pad Transparent with customizable buttons, I just map the buttons according to how I want by saying up key is for the up button on the keyboard etc?

    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?
  • quantumsheepquantumsheep Member Posts: 8,188
    Here's how I've done it - may not be the best way, but it *is* a way ;)

    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

  • butterbeanbutterbean Member Posts: 4,315
    Thanks Quantum! I'll try that out, appreciate all the details, good to have you lurking the forums again!

    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!
  • ktfrightktfright Member Posts: 964
    okay, i had a question for you all. i wanted to make custom buttons, and i made separate actors for them also, but... well let me better explain it...

    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.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    ktfright,
    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)
  • ktfrightktfright Member Posts: 964
    I understand, but for now, it is not possible until multitouch is enabled?
  • ktfrightktfright Member Posts: 964
    cool, i got my car actor to move forward, and it is surprisingly responsive, but now, using codemonkey's tip, i still can't do multitouch. i mean, i can move, but im not sure why it wont make my actor rotate left at the same time as pressing the gas button.im stuck now.
  • quantumsheepquantumsheep Member Posts: 8,188
    Which is why multitouch is so important. Either as part of the d-pad or our own buttons...

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • butterbeanbutterbean Member Posts: 4,315
    So multi-touch is not available as of now? Even with the default D-Pad?
  • quantumsheepquantumsheep Member Posts: 8,188
    No, it *is* available with the built in d-pad, just not available otherwise.

    Hope that's clear!

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • butterbeanbutterbean Member Posts: 4,315
    Bummer! Maybe an upgrade to the D-Pad to include directional pad plus 2 buttons?? :)
  • ktfrightktfright Member Posts: 964
    Well, I guess I gotta hold on making DRFT until multitouch is available. At least I can work on that top down shooter I'm doin'. :(
  • zombotszombots Member Posts: 186
    should make it so we can edit the d-pad. add/remove buttons. change images. that would be awesome.
  • butterbeanbutterbean Member Posts: 4,315
    That would be even better! But I think for an easy fix for now, adding another button would be great, every game needs at least two buttons and a D-Pad... hint.... hint.... :)
  • quantumsheepquantumsheep Member Posts: 8,188
    "Well, I guess I gotta hold on making DRFT until multitouch is available."

    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

  • ForteForte Member, PRO Posts: 297
    Quantum Sheep. I dont understand how i get the variable!
Sign In or Register to comment.