1 decade ago
by Alex
Hello,
Trying to make this work:
if( ig.input.pressed('up') && ig.input.pressed('shoot') ) { ... }
so that player would shoot up. It doesn't, suggestions?
I'd have something like this... Might need some tweaking, but that's the idea.
if( ig.input.pressed('up') && !this.upPressed ) {
this.upPressed = true;
}
if( ig.input.pressed('shoot') && this.upPressed ) {
// SHOOT UPWARDS
}
OR (because it's checking UP is being held and SHOOT is pressed)
if( ig.input.state('up') && ig.input.pressed('shoot') ) {
// SHOOT UPWARDS
}
1 decade ago
by Alex
Both of them work, thanks a lot!
p.s. - u'r missing "ig.input." before state in your 2nd example. just saying for people who'll have an error and don't know why :) cheers!
Page 1 of 1
« first
« previous
next ›
last »