For now, it's a fairly sedate affair. The primary goal is to reach the end of the stage by traversing obstacles (ex. jumping from one platform to another) and solving small puzzles along the way.
I haven't implemented any form of pathfinding just yet. If the player taps a ground tile that's far away, I planned to have the character run in that direction until an obstacle is encountered (ex. wall). If a pitfall is encountered while the previous action is being executed, the player can tap above the ground to jump over it.
Aah, fair enough--sounds fun. ^_^
In that case, I see little problem with using taps or swipes.
Thanks for the link.
Honestly, even if you don't find it useful--although, given your description above, I feel that you might--I found Silly Sausage to be a rather fun little game, and it's free, so I'm inclined to recommend it. ^_^
I really like the idea of utilizing "swipe" actions for movement.
Before we continue, I feel that I should add one caveat: In my own experience, quick "swipes" don't work quite as well with a mouse as with touch-based controls. They can be done, but I feel that they can be a little awkward at times. Touch-based swipes, on the other hand, can be wonderfully intuitive.
That said, the mouse may be perfectly fine when speed and precision aren't significant factors.
I'm probably overthinking this, but if I were to track the direction of a swipe, I would have to save the coordinates of the click, the coordinates of the release, and calculate a line/angle based on the two points, right? If I'm not mistake, elevation and power can be determined through the distance fomula? Sorry if I'm asking too many questions (not sure if I should go to mobile & console development for further inquiry).
I honestly haven't used HTML5 and JavaScript to a significant degree, so I don't know what facilities they offer. However, presuming that you have only the coordinates of your touches/mouse-clicks, as well as the press- and release- events, then what you describe sounds more or less correct, yes. It's vector maths and/or trigonometry, essentially.
Regarding the distance formula specifically, do I take it that you mean this? I'd suggest first checking that HTML5 or JavaScript don't offer pre-made vector-classes with functions like vector -subtraction and -length (which should hopefully calculate the distance for you--it's just the length of (pointA - pointB)), and trigonometric functions (which should allow you to calculate the elevation, if called for).
How are you moving your character during a jump? Do you have a velocity-vector, separate x- and y- velocities, or some sort of angle-and-speed arrangement? If the first, then you should be able to simply take the vector defined by (releasePoint - pressPoint), scale it appropriately, perhaps cap its length if called for, and use that as your character's jump-velocity. Separate x- and y- velocities would be similar, I believe, but might call for a bit more work on your end. Angle-and-speed arrangements would call for a bit of trigonometry to determine the elevation, I believe.