Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Mouse Controlled Engine


Recommended Posts

I've often times thought, that with the simplicity of Sonic the Hedgehog gameplay. You could in theory run it all through the mouse, giving it that on the fly type of game play. I'm considering running a future fan-game throughout these controls, and just want a little feedback.

Left/Right Movement:

Right-Click - Enables/Disables Movement

Once movement is enabled, you'd have to check Sonic's X Coordinate compared to the X-Coordinate of the mouse.

Once Sonic is within a certain number number of pixels away from the mouse, you'd have him start to decelerate.

If he's going too fast, and overshoots the mouse... Implement skidding...

Jumping:

Left-Click - Sonic Jumps

Crouching:

When movement isn't enabled, lowering the mouse below Sonic would cause him to crouch.

Spin-Dash

Left-Click while crouching. :D

Homing Attack

1.) User left-clicks on an enemy, Sonic Homing attacks enemy.

2.) User left-clicks, and Sonic Homing attacks in the direction of the click.

Acceleration

Given the touchiness of the mouse, you'd want to be able to manually control how fast Sonic moved...

My idea, is to use the mouse wheel. Scrolling up to increase speed, scrolling down to decrease speed. Two problems arise here:

1.) Not everyone owns a mouse with a scroll wheel.

2.) Not sure if MMF supports the mouse wheel.

The other idea, and the more realistic one. Is to vary Sonic's acceleration depending how far away Sonic is from the Mouse.

Sonic is 50 Pixels away: Set Max Speed to 2

Sonic is 1000 Pixels away: Set Max Speed to 50

Rolling

I'm still confused as to how I'd pull this off...

My idea would be to jerk the mouse in a circular movement, causing Sonic to roll out. The problem is, I'd have no clue as how to program this within MMF. I know it'd probably involve monitoring the X/Y coordinates of the mouse, and some of those lovely equations I learned in trigonometry.

My other idea would be to jerk the mouse underneath Sonic, to make him stop rolling. But due to slopes and such, I could see this leading to unintentional... and annoying rolling...

360 Movement

Now this flusters me a bit, as ideally you'd want to pull the mouse through the loops... and honestly I'd have no clue how to tweak a current 360 Engine to have the character cycle through the loop.

I'm sure someone here would know an easy fix for that though.

Overall, I just think it would be an unique (an unique, sounds like rubbish engrish... but it's correct engrish. :P) movement. More of a loose, on the fly. But keeping it as simple as moving your hand, and a few clicks of the mouse. I'm thinking of a few crazy gimmick ideas you could do too.

I honestly want to see "how much" you can get out of a "Mouse-Only" Sonic Engine. Whether it use, double clicking, click and drag, moving your mouse to certain patterns.

Obviously you would lose a little precision, but I think you could minimize that... and make it stable in many other ways... But blah, just up late with a bunch of ideas.

Comments, Insults, Critiques, Copyright Infringements...? :D

Link to comment
Share on other sites

If you want to effect Sonic's max speed based on distance, I'd make around 96 pixels away give you max speed; any more than that will force Sonic to slow down due to needing to move the mouse closer to nagivate slopes.

Alright anyways, I've never really considered putting mouse movement into a standard Sonic engine for I always felt it to be more of a control hastle that its worth. You see, the keyboard makes you feel like you're always in control of the character, especially in a platforming game like Sonic the Hedgehog. Though mouse control could be offered as an alternative, unless you make up some kind of altered Sonic game play then complete mouse control wouldn't work out too well imo. However, I've always been a fan of alternate control schemes so I don't really want to discourage you from doing this. ;>

Moving on, I'll leave some comments on ways you could/should/may-want-to do things.

1| Swap the left and right mouse buttons. The left mouse button should be left for what you do most, and you're more often to move than to jump. ( Hahah you could also let the player select if they're right of left handed. )

2| Double clicking the move button or holding down the jump button for a short period could be factors that make you roll; either that or a quick jerk down of the mouse ( that would be painful on my laptop mouse i-i ). To do a jerk, you could have an array constantly taking in the Y position of the mouse and checking the current Y from the Y of the mouse from about 300ms back. If the distance of the Y from these two occurences exceeds a certain amount such as 72 pixels, then the roll action can be triggered.

3| About the 360 movement and such, it's not as difficult as I would think. You want Sonic's movement to be triggered by an X comparison along with distance; well for 360 movement you just gotta add 360 onto that equation. =P Make sure to use a 2D distance equation for speed checking and let the comparison be based off of the X and Y by using Sonic's movement angle. Honestly I can't think of an equation to do this off of the top of my head, but I can show you a quick visual if that helps any.

mouse01.pngmouse02.png

Note that the 'line of judgement' to decide whether to move left or right is rotated based on Sonic's angle of movement. Though it's as simple as that, finding a nice equation to handle it without using huge active objects instead may take some playing around with.

And that's my two and a half cents.

Edit: Yes I've been practicing my straight lines. =[

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...