modifié : main.lua
This commit is contained in:
parent
c3b3e37331
commit
8cd8aa1e77
29
main.lua
29
main.lua
@ -10,13 +10,21 @@ PosPersonnage = {}
|
|||||||
PosPersonnage.X = 50
|
PosPersonnage.X = 50
|
||||||
PosPersonnage.Y = 400
|
PosPersonnage.Y = 400
|
||||||
PosPersonnage.Saute = false
|
PosPersonnage.Saute = false
|
||||||
PosPersonnage.tir = PosPersonnage.X + 35
|
PosPersonnage.tir = PosPersonnage.X + 50
|
||||||
PosPersonnage.tirY = PosPersonnage.Y
|
PosPersonnage.tirY = PosPersonnage.Y
|
||||||
|
|
||||||
tir = false
|
tir = false
|
||||||
Pistol = PosPersonnage.tir
|
Pistol = PosPersonnage.tir
|
||||||
|
|
||||||
|
Position = {}
|
||||||
|
Position.Vert_1 = {}
|
||||||
|
Position.Vert_2 = {}
|
||||||
|
Position.Horiz = {}
|
||||||
|
|
||||||
|
|
||||||
function Niveau()
|
function Niveau()
|
||||||
|
|
||||||
|
local i = 0
|
||||||
PositionVert_1 = 0
|
PositionVert_1 = 0
|
||||||
PositionVert_2 = 800
|
PositionVert_2 = 800
|
||||||
PositionHoriz = 565
|
PositionHoriz = 565
|
||||||
@ -25,20 +33,26 @@ function Niveau()
|
|||||||
love.graphics.line(PositionVert_1, PositionHoriz, PositionVert_2 , PositionHoriz)
|
love.graphics.line(PositionVert_1, PositionHoriz, PositionVert_2 , PositionHoriz)
|
||||||
PositionVert_1 = PositionVert_1 + 100
|
PositionVert_1 = PositionVert_1 + 100
|
||||||
PositionVert_2 = PositionVert_1 + 300
|
PositionVert_2 = PositionVert_1 + 300
|
||||||
|
|
||||||
|
Position.Vert_1[i] = PositionVert_1
|
||||||
|
Position.Vert_2[i] = PositionVert_2
|
||||||
|
Position.Horiz[i] = PositionHoriz
|
||||||
|
i = i + 1
|
||||||
end
|
end
|
||||||
love.graphics.rectangle("fill", 700, 220, 20, 20)
|
love.graphics.rectangle("fill", 700, 220, 20, 20)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Personnage(LaPostition)
|
function Personnage(LaPostition)
|
||||||
|
|
||||||
local x, y = PosPersonnage.X, PosPersonnage.Y
|
local x, y = PosPersonnage.X, PosPersonnage.Y - 45
|
||||||
|
--print( Position.Horiz[3] )
|
||||||
|
|
||||||
-- personnage
|
-- personnage
|
||||||
love.graphics.rectangle("fill", x, y, 10, 10)
|
love.graphics.rectangle("fill", x, y, 10, 10)
|
||||||
love.graphics.line(x + 5, y + 30, x + 5 , y )
|
love.graphics.line(x + 5, y + 30, x + 5, y )
|
||||||
love.graphics.line(x - 10, y + 15, x + 20, y + 15)
|
love.graphics.line(x - 10, y + 15, x + 20, y + 15)
|
||||||
love.graphics.line(x + 5, y + 30, x - 5 , y + 40)
|
love.graphics.line(x + 5, y + 30, x - 5, y + 40)
|
||||||
love.graphics.line(x + 5, y + 30, x + 15, y + 40)
|
love.graphics.line(x + 5, y + 30, x + 15, y + 40)
|
||||||
-- pistolet
|
-- pistolet
|
||||||
love.graphics.rectangle("fill", x + 20, y + 10, 5, 10)
|
love.graphics.rectangle("fill", x + 20, y + 10, 5, 10)
|
||||||
love.graphics.rectangle("fill", x + 20, y + 10, 15, 5)
|
love.graphics.rectangle("fill", x + 20, y + 10, 15, 5)
|
||||||
@ -78,12 +92,13 @@ function love.update(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if tir == true then
|
if tir == true then
|
||||||
|
PosPersonnage.tirY = PosPersonnage.Y
|
||||||
Pistol = Pistol + 3
|
Pistol = Pistol + 3
|
||||||
end
|
end
|
||||||
|
|
||||||
if Pistol > love.graphics.getWidth() then
|
if Pistol > love.graphics.getWidth() then
|
||||||
Pistol = PosPersonnage.tir
|
|
||||||
PosPersonnage.tirY = PosPersonnage.Y
|
PosPersonnage.tirY = PosPersonnage.Y
|
||||||
|
Pistol = PosPersonnage.tirY
|
||||||
tir = false
|
tir = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -94,7 +109,5 @@ function love.draw()
|
|||||||
Personnage(LaPostition)
|
Personnage(LaPostition)
|
||||||
|
|
||||||
--tir
|
--tir
|
||||||
if tir == true then
|
|
||||||
love.graphics.rectangle("fill", Pistol, PosPersonnage.tirY + 10, 2, 2)
|
love.graphics.rectangle("fill", Pistol, PosPersonnage.tirY + 10, 2, 2)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user