How to avoid input being pressed for x seconds

P

ProjectJM

Guest
Hello, is there a way to disable an input (BUT NOT ITS ACTIONS!) for x seconds or under some circumstances ?
 

obscene

Member
Well if that happens you programmed it wrong :p

// Psuedocode
if input_available
{
get input
}

// Separately
if input
{
do something
}
 
P

ProjectJM

Guest
Well if that happens you programmed it wrong :p

// Psuedocode
if input_available
{
get input
}

// Separately
if input
{
do something
}
Lol :D

Well it's a mess I think, because in that "do something" piece of code I need the keyboard input to be disable!
But I want just that to be disable, not the animation in it (by pressing right the player starts playing an animation)
 

obscene

Member
Well the idea is to separate controls from actions. You need to do this anyway if you plan on using any kind of keyboard customization options later. Get the input, assign a variable and then have your objects check those variables to perform the actions. This way you can stop getting input but those variables would retain their values.
 
P

ProjectJM

Guest
Doesn't matter, I SOLVEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED!!!!!!!!!!!!!!!!!!!!!!!!!!!

I used a custom event to wash away my problemmmmmms!
 
Top