Happy New Year, Hello and Some Advice pls?

ChobbifaceChobbiface PRO Posts: 491
edited November -1 in Working with GS (Mac)
Happy New Year everyone! and Hello, introducing myself for the first time on the forums. I actually joined about half a year ago on the subscription program, but never got round to using Gamesalad until this last week, and it turns out you no longer need subscription for the basic gamesalad now he he.

Anyway, I've just started my first game! I'm a total newbie to game development and like most people here, I'm really excited at being able to design my own games with minimal coding. I have a question about character movement. At the moment, my actor image is facing forward (i.e. looking at you) in the resting state. I want it to animate running right and left when appropriate (I have the animation images done). As this game is for the iphone/ipad, I want a touch event to trigger the movements. So, if my actor is in the standing/resting position, tapping on any screen to the right of him will make him animate and walk to the right, and tapping on any screen left of him, will make him animate and walk to the left where I touched, if that makes sense. I've read the tutorials and this can be achieved with keyboard input, though I'm not sure how you do this with touch input.

Thanks in advance.

Chobbipod.

Comments

  • AsymptoteellAsymptoteell Member Posts: 1,362
    Make two actors each taking up one half of the screen. In their attributes, unchecked visible. Then make rules in the one on the left where when touch is pressed and touch is inside, animate the left running. Then do the same for the acor on the right but with the right running sequence.

    Welcome to the forums by the way.

    Asymptoteell
  • DimensionGamesDimensionGames PRO Posts: 993
    Asymptoteell said:
    Make two actors each taking up one half of the screen. In their attributes, unchecked visible. Then make rules in the one on the left where when touch is pressed and touch is inside, animate the left running. Then do the same for the acor on the right but with the right running sequence.

    I think you would want to constrain the actors to the camera so that they move accordingly with the camera :)
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Good point.
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    welcome and happy new year
  • ChobbifaceChobbiface PRO Posts: 491
    Hey, thanks everyone :) Asymptoteell, sorry as I really don't have that much experience, I don't quite fully understand how that works. I have made 2 actors, each covering one half of the screen, though from there I'm not sure where I'm supposed to put the rules to animate/move. If I put rules in to move/animate in the left and right actors covering half the screens, how would that make my actual character/person move, as I'm not actually applying any rules to the person? Can someone elaborate a bit more?

    Much appreciated
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Sorry. My mistake. You'd need to make it so there's 2 scene or game attributes called run right and run left. In the left side's rule, change attribute run left to 1. In the right side's rule, change run right to 1.

    In the character's rules, make two rules that say when run right=1, animate (running right.)
    And another saying when run left=1, animate (running left)

    Sorry about the mistake. I wasn't thinking.

    Happy new year and welcome to the forums.
    Asymptoteell
  • ChobbifaceChobbiface PRO Posts: 491
    Thanks a lot Asymptoteell. That was very helpful! I've almost got it to how I want. There is just one problem still. Now when I click into the left half of the screen, the run left attribute will be set to 1 as you said, and my character will move there and animate running left as he does. Now, if I wanted him to then move to the right a little bit, (but still within the left half of the screen), he won't (and will not animate running right), as this is still in the left half of the screen if you see what I mean. If I click far out to the right half of the screen then he will move there as is the rule. Is there any way around it?

    Also, does anyone know if there are any tutorials on gamesalad on touch movement and animation? I can't seem to find many, I would've thought a lot of people would do this commonly. I've looked at http://gamesalad.com/wiki/how_tos:gsc_animate_direction but it doesn't seem to be very clear or work. But maybe that's just me, my brain is a bit dead at 2am here in the UK :)

    Thanks again for any help.

    Chobbipod
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Are you saying you want it so if it's even a little bit to the left of the actor where you press, you want it to go left? And the same if it's a little to the right for moving right? If so, use a rule that states if attribute self.position x < mouse.position.x and touch is pressed, then (animate and move right. And onother where if position x > mouse position x and press is pressed, then animate and move left.
  • ChobbifaceChobbiface PRO Posts: 491
    Thanks for all your help! I've tried what you mentioned above, unfortunately can't get it to work quite right at the moment. I will try and see if there are any demos around, though there doesn't seem to be many on touch movement.
Sign In or Register to comment.