Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- player.tilex_droite = math.ceil((player.x+origX+10)/40)
- player.tilex_gauche = math.ceil((player.x+origX-10)/40)
- player.tiley_bas = math.ceil((player.y+20)/40)
- player.tiley_haut = math.ceil((player.y-20)/40)
- print(player.tiley_bas)
- if tilemaps[1][player.tiley_bas][player.tilex_gauche] == 0 and tilemaps[1][player.tiley_bas][player.tilex_droite] == 0 and player.jump == false then
- player.y = player.y + 1
- end
- if player.jump == true then
- if tilemaps[1][player.tiley_haut][player.tilex_gauche] == 0 and tilemaps[1][player.tiley_haut][player.tilex_droite] == 0 then
- player.y = player.y - 1
- end
- end
- if player.dir == 1 then
- if tilemaps[1][player.tiley_bas-1][player.tilex_droite] == 0 and tilemaps[1][player.tiley_haut-1][player.tilex_droite] == 0 then
- if player.x < 230 then
- player.x = player.x + 1
- else
- spritemap:translate(-1,0)
- origX = origX + 1
- end
- end
- end
- if player.dir == 2 then
- if tilemaps[1][player.tiley_bas-1][player.tilex_gauche] == 0 and tilemaps[1][player.tiley_haut-1][player.tilex_droite] == 0 then
- if player.x > 150 then
- player.x = player.x - 1
- else
- spritemap:translate(1,0)
- origX = origX - 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment