Trouble controlling a character

craigybwoycraigybwoy Member Posts: 6
edited November -1 in Working with GS (Mac)
Hi forum, I am a new developer and I am having trouble with controlling the character. What I am looking to do is as follows:

1) touch the actor To highlight him
2) touch a location on screen for him to walk towards.

Any help would be appreciated.

Thanks in advance
Craig

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    You could simplify this by just making the character walk to the mouse x/y position when pressed.

    Unless there's a reason you're highlighting the character to begin with?

    QS

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

  • craigybwoycraigybwoy Member Posts: 6
    Thanks for the response, but there are a couple of actors on screen and the user needs to be able to move them independently. the first touch is to identify what character they require and the second is to identify the position that the actor is to move to.
  • simo103simo103 Member, PRO Posts: 1,331
    if you open New in GS and search for this demo I think it does exactly what you are looking for:

    EXAMPLE: Select with mouse and click to move (extended)

    let me know if you can't find and/or download it.
  • craigybwoycraigybwoy Member Posts: 6
    Perfect! Thank you :) I do have one more question which I am sure is pretty obvious.. Once I have added a actor how do I delete them from the stage?
  • simo103simo103 Member, PRO Posts: 1,331
    generally people would use the Destroy behavior based on a trigger like touch or touch then a timer.

    However there is the option of setting the rule to move the actor offscreen but setting its X and Y values to an X and Y value that is out of your camera. I believe in the right case this is a good move to preserve FPS if you are moving, spawning and destroying a number of actors.

    If that doesn't cover what you need can you be a little more specific by describing your gameplay a bit?
Sign In or Register to comment.