Guest User

Post forum Corona

a guest
Sep 9th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. player.tilex_droite = math.ceil((player.x+origX+10)/40)
  2.     player.tilex_gauche = math.ceil((player.x+origX-10)/40)
  3.     player.tiley_bas = math.ceil((player.y+20)/40)
  4.     player.tiley_haut = math.ceil((player.y-20)/40)
  5.         print(player.tiley_bas)
  6.     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
  7.         player.y = player.y + 1
  8.     end
  9.     if player.jump == true then
  10.         if tilemaps[1][player.tiley_haut][player.tilex_gauche] == 0 and tilemaps[1][player.tiley_haut][player.tilex_droite] == 0 then
  11.             player.y = player.y - 1
  12.         end
  13.     end
  14.     if player.dir == 1 then
  15.         if tilemaps[1][player.tiley_bas-1][player.tilex_droite] == 0 and tilemaps[1][player.tiley_haut-1][player.tilex_droite] == 0 then
  16.             if player.x < 230 then
  17.                 player.x = player.x + 1
  18.             else
  19.                 spritemap:translate(-1,0)
  20.                 origX = origX + 1
  21.             end
  22.         end
  23.     end
  24.     if player.dir == 2 then
  25.         if tilemaps[1][player.tiley_bas-1][player.tilex_gauche] == 0 and tilemaps[1][player.tiley_haut-1][player.tilex_droite] == 0 then
  26.             if player.x > 150 then
  27.                 player.x = player.x - 1
  28.             else
  29.                 spritemap:translate(1,0)
  30.                 origX = origX - 1
  31.             end
  32.         end
  33.     end
Advertisement
Add Comment
Please, Sign In to add comment