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