Swipe Motion help

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • So i'm playing with my controls and trying a "swipe" motion based movement system.

    I'm having troubles with the angle system since the motion system uses relative angle checking. C2 uses -180 to 180 making simple angle checking difficult.

    Image here(   https://docs.google.com/drawings/d/1auRRMO3CokJ-wqP7X104lPED74fcx03W6zs-pK7Dlsc/edit   )

    Image

    There are 3 samples of an arrow with the relative direction.

    The control works by having the player put their finger on the arrow first. Then release the finger in the relative direction.

    Forward works well as I can use "Within". However, trying to use the relative angle for left and right turning is not working at all. well it works when the object is in the original position as that is the angle.

    So is there a way to use within to check an angle that isn't the angle of the arrow or is there another way to handle how the angle system works.

  • Hmmmm.. great concept you have going there....

    You just inspired me a great deal...I hadn't ever though of doing something like that...very nice...has a lot of potential..

    As to your problem..

    Are you using any kind of Helper Sprites?

    I would suggest that as an option, First and foremost

    They are really handy..and help conceptualize what you are trying to achieve and can even have code or events keyed into them...to assist the mechanics of your game.

    Invisible helpers are basically simple sprite objects that can be any shape or appearance that help out the mechanics of ANY system...

    In this case they could be Sprite representations of the Angle "Arcs" that you wish to cover...These sprites, when you create them and load them into CS2 can be set to any angle you like..so you can almost "prefabricate" your whole set up visually & mechanically first...Keeps it all unified if you know what I mean

    By replicating the Mathematics of angle checking with visual guides you would have a much easier time of understanding the System

    Does that make sense?

    Don't forget you could always run a testing function as well by having a HUD display that has "Text" object for each angular Field Arc sprite and has it continually update on screen so that you can see exactly what relative angle is happening at any time..this would give you some proper analysis feedback to plan out your system better ...much like an on screen frame rate update but it displays the relative angle..

    :)

    Your idea is a great one...yes definitely interesting approach..:)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks. Not as elegant as knowing how to do the angle system and math checks, but it was WAY easier to implement and works. I popped two empty sprites at the center location. pinned and rotated them to 90 degress(relative) and then used the same event as I did with the working move forward. Worked great on the first go.

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