Playing digital controls as pseudo-analog

0 favourites
  • 5 posts
From the Asset Store
Shoot your way through with these 4 exciting, fun, energetic, and upbeat music tracks and 14 sound effects
  • Later on, I plan to incorporate analog controls to my game using a USB Xbox controller to allow for micro-movement. But for now, I'm using digital, all-or-nothing controls while I get the game set up. With that in mind, I have the following scenario that I'd like some suggestions on how to make a reality...

    During my stealth game, there will be certain "audible" triggers that will alert the enemy that something/one is nearby, but it won't activate the chase status... Right now, I have a "water" object to simulate a puddle on the ground. When the player walks through it, it's suppose to generate a "splash" sound (that's to come later...). However! If you "tip-toe" through the puddle, virtually no sound will be made and the enemy will not be alerted. This is difficult to do when you have digital controls.

    So what I'm thinking is to have a test where an audio trigger won't be generated until the player has walked so many steps through the water. Say, every 10+ steps, alert enemy. If the player stops before reaching ten steps, then it's akin to having walked softly (slowly) through the water.

    I'm using the 8-Direction for controls via the keyboard presently. (Again, later on I will incorporate analog controls to make it easier to walk slow/fast. But not everyone will have analog controllers, of course.)

    Suggestions on how to make this work, please? Thank you!

  • Why not offer a walk stance button instead to replace the analog value.

    Right - Normal Right

    Double tap Right - Faster Right

    press 'z' - stealth mode

    • Right - slow stealth Right

    OR

    Right = Normal Right

    Shift Right = Slow Right

    this would be similar to what you would be trying with an analog to keyboard. This would be easier than counting the steps and would be more ready to implement for analog. As your suggesting would be to create a mechanic now that you might not use later.

    However, if your going to do the "10 step".

    OnMove

    • startAlertTimer = -1

    --> startAlertTimer = time + 500(time 10 steps)

    • If startAlertTimer < time

    --> AlertTriggerCheck

    MoveOver

    --> startAlertTimer = -1

    that's just a suggestion of course

    you can check for if the animation reaches a specific frame

    OnRight

    • If sprite.animationframe = 8(frame 8 for a step on the ground?)

    --> alertStep++

    • If alertStep = 10

    --> alert Check

    good luck :)

  • What about just checking the speed of the player? If you just tap the arrow key it shouldn't get up to full speed so it would be similar to holding the analog stick halfway.

    Example: sneak.capx

  • I'm not sure about these ideas... I've never really played that many sidescrolling stealth games...

    What if the player doesn't immediately start running when the movement keys are pressed? Holding down the left or right arrow key will make the character start moving slowly until they get to walking speed. Holding and releasing these keys in a certain rhythm could cause a slow walk or sidestepping movement or something...

    (This would probably be weird to get used to... :P)

    You could also try crouch/down arrow key + arrow keys for slowed movement and a sprint button/double-pressed arrow keys for running.

    (This is probably most practical...)

    Or the character could just move slowly by default :P

    I don't know... Take a look at other sidescrolling stealth games on PC and see what they did!

    (I recall a Williams arcade game called "Bubbles" that did a sort of analog movement with a digital joystick. I doubt that helps though... :P)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Zero6 & ramones - Actually, you two just game me a good idea for what to do: Something to the affect of adjusting the acceleration and max speed after a certain value is reached.

    Something to the effect of

    Max speed: ###

    -> speed < ###

    --> acceleration = #

    -> speed >= ####

    --> acceleration = ##

    Or something to that effect.

    jayderyu - I actually like that "on animation frame" idea. ALSO good.

    Time to experiment...

    (Other ideas are welcome if you think of any.)

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