summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar alecdwm 2016-03-19 03:53:38 +0100
committerGravatar alecdwm 2016-03-19 03:53:38 +0100
commit592c9da30298ec40e5046c51e2447aba5144330f (patch)
treece3067c1a20d9a39df93ccfef9bcdc2098239ec1
parent75af64b8f4593450c5b6445ea10f80accc554334 (diff)
Redefined some tiles + their behaviour
-rw-r--r--prototype/player.lua41
-rw-r--r--prototype/ship.lua17
-rw-r--r--prototype/ship.pngbin350 -> 350 bytes
3 files changed, 36 insertions, 22 deletions
diff --git a/prototype/player.lua b/prototype/player.lua
index 4d8a04c..273b032 100644
--- a/prototype/player.lua
+++ b/prototype/player.lua
@@ -92,27 +92,40 @@ end
function player:moveStep(x, y)
if self.parent.map[y+1][x+1] == 0 then
-- space
- return
- end
- if self.parent.map[y+1][x+1] == 1 then
+
+ elseif self.parent.map[y+1][x+1] == 1 then
-- wall
- return
- end
- if self.parent.map[y+1][x+1] == 2 then
+
+ elseif self.parent.map[y+1][x+1] == 2 then
-- floor
self.localX = x
self.localY = y
- return
- end
- if self.parent.map[y+1][x+1] == 3 then
- -- display panel
- return
- end
- if self.parent.map[y+1][x+1] == 4 then
- -- control panel
+
+ elseif self.parent.map[y+1][x+1] == 3 then
+ -- flight display panel
+ self.localX = x
+ self.localY = y
+
+ elseif self.parent.map[y+1][x+1] == 4 then
+ -- flight control panel
self.localX = x
self.localY = y
self:pilotShip(self.parent)
+
+ elseif self.parent.map[y+1][x+1] == 5 then
+ -- airlock
+
+ elseif self.parent.map[y+1][x+1] == 6 then
+ -- fuel control panel
+ self.localX = x
+ self.localY = y
+
+ elseif self.parent.map[y+1][x+1] == 7 then
+ -- fuel line
+
+ elseif self.parent.map[y+1][x+1] == 8 then
+ -- engine
+
end
end
diff --git a/prototype/ship.lua b/prototype/ship.lua
index 49f78dd..a903baa 100644
--- a/prototype/ship.lua
+++ b/prototype/ship.lua
@@ -19,11 +19,12 @@ ship.rotDragEnabled = false
-- 0 = empty
-- 1 = wall
-- 2 = floor
--- 3 = glass
--- 4 = control panel
+-- 3 = flight display panel
+-- 4 = flight control panel
-- 5 = airlock
--- 6 = fuel line
--- 7 = engine
+-- 6 = fuel control panel
+-- 7 = fuel line
+-- 8 = engine
ship.map = {
{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
@@ -38,10 +39,10 @@ ship.map = {
{0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1},
{0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1},
{0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1},
- {0, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 1},
- {0, 0, 1, 1, 2, 2, 6, 6, 6, 2, 2, 1, 1, 0},
- {0, 0, 0, 0, 1, 1, 1, 6, 1, 1, 1, 0, 0, 0},
- {0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 0, 0, 0, 0},
+ {0, 1, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 1},
+ {0, 0, 1, 1, 2, 2, 7, 7, 7, 2, 2, 1, 1, 0},
+ {0, 0, 0, 0, 1, 1, 1, 7, 1, 1, 1, 0, 0, 0},
+ {0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 0, 0, 0, 0},
}
function ship:load()
diff --git a/prototype/ship.png b/prototype/ship.png
index 1b84270..3ab2197 100644
--- a/prototype/ship.png
+++ b/prototype/ship.png
Binary files differ