Swipe Motion help

Get help using Construct 2

Post » Wed Nov 07, 2012 7:41 am

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.jayderyu2012-11-07 07:46:26
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Wed Nov 07, 2012 8:53 am

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..:)
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
30
S
11
G
8
Posts: 313
Reputation: 7,360

Post » Wed Nov 07, 2012 8:44 pm

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.



B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834


Return to How do I....?

Who is online

Users browsing this forum: h1k3, Unconnected and 1 guest