Hi,
I’m trying to develop a game like [Parappa the rapper] but I’m a little bit lost with this.
I already know how to listen the keyboard events, but I don’t know how to change the image when the user tap an arrow key.
This is my javascript code:
var moveUp : KeyCode;
var moveDown : KeyCode;
function Update () {
if (Input.GetKey(moveUp))
{
//Change image from sprite
}
else if (Input.GetKey(moveDown))
{
//Change image from sprite
}
else
{
//Change image from sprite
}
}
Can anybody help me?
Thanks 🙂




