character respond to touch/animations

0 favourites
  • 13 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Ok so I am new at this. I am familiar with the way to make a character respond to touch indirectly through objects. Like "clicked on left arrow. simulate 8 direction to left" As well as how to make touch control work for a single animation.

    But I was wondering if there's a way to make a character go a certain direction by using touch controls {b}corresponding to the animations{/b}, walkup, walkdown,walkright, walkleft. The game I am working on is a RPG so side scroll controls wont work in this game. I was wondering you guys could help me out at all possibly. Thanks

    -Seth

  • I am currently working on an RPG and I am using a joystick object and directional panel. When the player drags the joystick and overlaps one of the panels it triggers the movement event. When the player lets go of the Joystick it Activates a group of events the move the joystick back to its source and then Deactivates the group. I am using a dictionary object to retain location and direction data for webstorage later.

    I can screen shot my events if you like but this flow chart might help:

    <img src="https://lh6.googleusercontent.com/-rUyaGJUF804/UV3epgRVy0I/AAAAAAAAC4A/HemHwLEjOlo/s1544/C2-KB%26JS-++Movement.png" border="0" />

  • That would be great if you could give me some screenshots. Thanks appreciate it. How do you use a dictionary? Thanks

  • I really wont it to respond to touch with the corresponding animations. :)

  • Basically a dictionary is a place to store information as global variables. It makes it easy to pre-program lots of content into your game in notepad form without having create an event for each entry. Here is how to set one up:

    Capx Example

    Dictionary Setup

    1. Create a dictionary object (this is a global object)

    2. Create what I call a "validate button"

    -Create text box called validate

    -Create event "On left click of object 'textbox validate' download DictionaryasJSON AND set textbox value to DictionaryasJSON

    3. Launch your game and click on the 'validate' object and download the JSON file. This will provide you with a template for adding values by hand instead of having to push them all initially.

    4. Find the JSON file and put in all your keys and values (you will need to set it to open with notepad)

    5. Save the JSON notepad text file and in construct2 right click on the "Files" folder on the project list typically on the right hand side and select "Import files" then select the JSON file you just modified. (from now on you can doubleclick the JSON file in the project to modify it and blow the other one away.

    6. Set your "on layout load" to set the dictionary to the contents of the JSON file (this is to initially populate it, these values will remain as long as the game is running as it is stored in RAM)

    7. Now you can use the Dictionary Set key and Dictionary.Get to call upon values like to set and start the name of an animation stored in it.

    Json Validator

    Here is my event view for the virtual joystick and keyboard controls

    <img src="https://lh6.googleusercontent.com/-3T5Q5b_wNSI/UV4KM6XbnPI/AAAAAAAAC4Q/61YQs3Tor4E/s956/Joystick%26Keyboard+Movement2.png" border="0">

  • K so I finally figured out how to make touch respond to animations it was so simple I couldn't believe it took me so long.

    So what I did make a first sprite the animated one select behavior "pin to". Then make a second blank sprite and select "8 direction". Then make a 3rd blank sprite. Pin it to sprite 2. Then create 4-8 blank sprites corresponding to the directions. Pin them to the 3rd sprite. Then in event sheet select "is in touch." It's pretty straight forward cannot believe I didnt think about that.

  • It just basic eight behavior movement with a little bit of a twist

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It just basic eight behavior movement with a little bit of a twist

    Really!? do share a screen shot of your event sheet. Glad you found a way that works for you!

  • <img src="" border="0" />

  • <img src="https://sites.google.com/site/snewman8771/my-forms/screenshot.pngattredirects=0&d=1" border="0" />

    K so basically I used the regular method to get 8-direction. By creating a animated sprite. Then creating a blank sprite and pinning it the the animated one.

    Then I created a 2nd blank sprite about 3 times the size of the second sprite. Then pined it the the first blank sprite. Then I created 4 blank sprites that correspond to directions. and pinned all then to the third one. It follows player around wherever he goes.

  • i dont know why the imaage isnt showing

  • I dont know why the image inst showing

  • <img src="https://sites.google.com/site/snewman8771/my-forms/screenshot.jpgattredirects=0&d=1" border="0" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)