Xathia Vastar
Member
What would be the syntax I need to write in Rubyscript in order to make the player face in different directions? Apparently this doesn't seem to work:
I get an error saying that self.direction is an invalid syntax. So what would be the right syntax to use to make the player face in the direction?
Code:
#Making the player face and move right when the right arrow key is pressed
if Input.dir4 == 6 #if right arrow key is pressed
self.direction = 6 #player faces right
self.x += 2 #move player right
end
I get an error saying that self.direction is an invalid syntax. So what would be the right syntax to use to make the player face in the direction?