Help needed for touch based game.

0 favourites
  • 4 posts
From the Asset Store
Surena Touch
$2.50 USD
A wrap from official Touch plugin to export touch/mouse input to other plugins.
  • I read about the New Grounds competition and decided to give it a shot. I started working on the concept hoping that adding touch controls will be as easy as keyboard ones but after trying alot Im just unable to do it. Iv read touch based tutorial and manual and Im unable to find my answers. Can you help me out?

    I really want to do this game as it is based on one of the major current issues of sexual abuse/assault which goes well with the theme "touch"

    <img src="http://i29.photobucket.com/albums/c252/killermachinez/touch.jpg" border="0" />

    My main problems here are

    1. I need to visually move my yellow character from one green spot to another.

    2. If the spot has disappeared it needs to move to the closest spot.

    3. I need to make sure that the enemies cannot come in this green spot.

    4. If the player character overlaps enemy character it is destroyed.

    Now I think I'l be able to do the last one but I really have no idea how to do first 3. When I tried to move the yellow character On Touch using Set Position it just pops on the lamp. Also I had to create new lamp because the character would adjust in same lamp if other lamp was a duplicate of the first one.

    I hope you can guide me on this. An example of this concept is Police Rush by Konami itunes.apple.com/us/app/field-prowlers-police-rush-us/id338139876

  • what's the blue player character for? can he switch on/off lamps?

    1. try to use the pathfinder behaviour. there is a very good example built in in construct just look for the pathfinder example when you hit new project.

    2. the distance between two sprites can be calculated with the distance() command. for example: distance(lamp1.X,lamp1.Y,yellowP.X,yellowP.Y) then you could save the distances to an array, sort the array by numbers and pick the smallest one. i havent workd much with arrays by now .. maybie there is an easier solution.

    3. how do the enemeys move? with sine behaviour? (like up and down) or do they change directions and chase the yellow guys? you could use something like every tick , if enemey is on collision with green lamp -> set position to self.X , self.Y then he will just keep staying there as soon as he gets in touch with a lamp so he'll not be able to move inside the lamp.

    4. player, on collision with enemy -> destroy

    i hope this could help a bit.. otherwise u may need to be more specific or someone with more C2 skills has to join in here ..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for your reply and Im sorry for not giving a clear explanation. The blue character is for killing the enemy characters.

    As for your reply on points-

    1 - I tried to use the pathfinder template but I faced 2 problems

    a- If I created a box and made it solid, the character would pass through it. Being on same or different layer made no difference.

    b- Because of problem "a" I could not figure out if the character will be able to find its "new" path once it collides with the wall or building.

    2- Ok i will give it a try. With this, will the yellow character change its path to move to another lamp in the case of first one going out?

    3- This is a top view game so they will move straight with bullet behaviour. I will try what you are explaining.

    4- I was thinking in similar way.

    My main concern is point 1. If I can get that right I will be able to use it on enemies as another layer where they will try to find alternate paths while moving between lamps. It will also need to be implemented on blue player. Then blue player will be able to move one the point selected by user.

    One way I thought while writing this reply was to create a dotted line from blue player to the point selected by the user. This dotted line can be drawn only in movable area. The blue player can then follow this line. You think this is possible to achieve?

  • i guess this would be possible to achieve but way to much effort since the pathfinding behaviour is actually doing this for you.

    I assume your problem in Point 1 is that you havent set the Settings on the Blue players Pathfinder Behavoir in the right way. There is a selectable area called "Obstacles" where you can choose between "Solids" and "Custom". If you hit Solids there and apply a solid behavior to all your walls or whatever the pathfinding behaviour should work for you.

    3. you could use like: on collision with "green lamp" -> set the enemeys movement speed to 0.

    EDIT: Just open the example file for Pathfinder in Construct and look how it's done there. (New->Pathfinder Example)

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