How would I make it so if the W and the Shift key is pressed at the same time, it would play a different sound?
var PlayFootsteps = pc.createScript('playFootsteps');
// initialize code called once per entity
PlayFootsteps.prototype.initialize = function() {
};
// update code called every frame
PlayFootsteps.prototype.update = function(dt) {
var pressed = false;
if (this.app.keyboard.isPressed(pc.KEY_W)) {
pressed = true;
}
if(this.app.keyboard.isPressed(pc.KEY_A)){
pressed = true;
}
if (this.app.keyboard.isPressed(pc.KEY_S)) {
pressed = true;
}
if(this.app.keyboard.isPressed(pc.KEY_D)){
pressed = true;
}
if (pressed) {
if (!this.entity.sound.slot('Walking').isPlaying) {
this.entity.sound.play('Walking');
}
} else {
this.entity.sound.stop('Walking');
}
};