Please help #2077
suzukiception
started this conversation in
General
Please help
#2077
Replies: 1 comment
-
Put a comma after hero.direction |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, i started coding this for my new game:
game= {
width = 240,
height = 136
}
hero = {
x = game.width / 2,
y = game.height /2,
width = 10,
height= 10,
direction= 0
sprite= 0
}
function TIC()
cls(0)
if btn (0) and hero.y > 0
then hero.y = hero.y - 1
hero.sprite=2
end
if btn (1) and hero.height < game.height
then hero.y = hero.y + 1
hero.sprite=1
end
if btn (2) and hero.x > 0
then hero.x = hero.x - 1
hero.direction = 1
end
if btn (3) and hero.width < game.width
then hero.x = hero.x + 1
hero.direction = 0
end
spr(
hero.sprite,
hero.x,
hero.y,
0,
2,
0,
0
)
end
And even though i've closed the brackets, this error keeps showing up:
[string "-- title: game
title..."]:21: '}' expected (to close
'{' at line 15) near 'sprite'
what should i do?
Beta Was this translation helpful? Give feedback.
All reactions