Fixed conflicts due to me being stupid and not using "git rm"
Merge branch 'master' of ssh://git.plhsystems.co.uk:8022/var/lib/git/project
BIN
graphics/chest opening.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
graphics/closed chest.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
graphics/cloud.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
graphics/key.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
graphics/mummywalking.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
graphics/mummywalking1.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
graphics/mummywalking2.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
graphics/mummywalking3.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
graphics/pixel chest.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
graphics/you've won.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
|
|
@ -112,6 +112,21 @@ images {
|
||||||
images {
|
images {
|
||||||
image: "/graphics/level3.png"
|
image: "/graphics/level3.png"
|
||||||
}
|
}
|
||||||
|
images {
|
||||||
|
image: "/graphics/pixel chest.png"
|
||||||
|
}
|
||||||
|
images {
|
||||||
|
image: "/graphics/closed chest.png"
|
||||||
|
}
|
||||||
|
images {
|
||||||
|
image: "/graphics/key.png"
|
||||||
|
}
|
||||||
|
images {
|
||||||
|
image: "/graphics/you\'ve won.png"
|
||||||
|
}
|
||||||
|
images {
|
||||||
|
image: "/graphics/cloud.png"
|
||||||
|
}
|
||||||
animations {
|
animations {
|
||||||
id: "run_left"
|
id: "run_left"
|
||||||
images {
|
images {
|
||||||
|
|
@ -235,4 +250,21 @@ animations {
|
||||||
}
|
}
|
||||||
playback: PLAYBACK_LOOP_FORWARD
|
playback: PLAYBACK_LOOP_FORWARD
|
||||||
}
|
}
|
||||||
|
animations {
|
||||||
|
id: "walking_mummy"
|
||||||
|
images {
|
||||||
|
image: "/graphics/mummywalking.png"
|
||||||
|
}
|
||||||
|
images {
|
||||||
|
image: "/graphics/mummywalking1.png"
|
||||||
|
}
|
||||||
|
images {
|
||||||
|
image: "/graphics/mummywalking2.png"
|
||||||
|
}
|
||||||
|
images {
|
||||||
|
image: "/graphics/mummywalking3.png"
|
||||||
|
}
|
||||||
|
playback: PLAYBACK_LOOP_FORWARD
|
||||||
|
fps: 10
|
||||||
|
}
|
||||||
extrude_borders: 2
|
extrude_borders: 2
|
||||||
|
|
|
||||||
|
|
@ -604,6 +604,9 @@ embedded_instances {
|
||||||
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
"}\\n"
|
"}\\n"
|
||||||
"\"\n"
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" z: 0.1\n"
|
||||||
|
" }\n"
|
||||||
" scale {\n"
|
" scale {\n"
|
||||||
" x: -0.4\n"
|
" x: -0.4\n"
|
||||||
" y: 0.4\n"
|
" y: 0.4\n"
|
||||||
|
|
@ -751,7 +754,7 @@ embedded_instances {
|
||||||
" position {\n"
|
" position {\n"
|
||||||
" x: 527.5\n"
|
" x: 527.5\n"
|
||||||
" y: 344.0\n"
|
" y: 344.0\n"
|
||||||
" z: 0.4\n"
|
" z: 0.5\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" scale {\n"
|
" scale {\n"
|
||||||
" x: 1.3\n"
|
" x: 1.3\n"
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ function init(self)
|
||||||
msg.post("level1:/pause#sprite", "disable")
|
msg.post("level1:/pause#sprite", "disable")
|
||||||
msg.post("/player#player", "level1")
|
msg.post("/player#player", "level1")
|
||||||
msg.post("main:/controller#main", "play background music")
|
msg.post("main:/controller#main", "play background music")
|
||||||
|
msg.post("/mummy#mummy", "creator", { creator = msg.url() })
|
||||||
print("level1")
|
print("level1")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -122,6 +123,18 @@ function on_message(self, message_id, message, sender)
|
||||||
end
|
end
|
||||||
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
||||||
end
|
end
|
||||||
|
if message_id == hash("manual_pause") then
|
||||||
|
if not self.paused then
|
||||||
|
self.paused = true
|
||||||
|
-- msg.post("/pause#sprite", "enable")
|
||||||
|
-- msg.post("/player#player", "pause")
|
||||||
|
for i, id in ipairs(self.curses) do
|
||||||
|
local id_url = msg.url(id)
|
||||||
|
msg.post(id_url, "pause")
|
||||||
|
end
|
||||||
|
self.won = true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
|
|
|
||||||
|
|
@ -264,8 +264,8 @@ embedded_instances {
|
||||||
" shapes {\\n"
|
" shapes {\\n"
|
||||||
" shape_type: TYPE_BOX\\n"
|
" shape_type: TYPE_BOX\\n"
|
||||||
" position {\\n"
|
" position {\\n"
|
||||||
" x: 855.0\\n"
|
" x: 867.0\\n"
|
||||||
" y: 532.0\\n"
|
" y: 533.0\\n"
|
||||||
" }\\n"
|
" }\\n"
|
||||||
" rotation {\\n"
|
" rotation {\\n"
|
||||||
" z: 0.013529582\\n"
|
" z: 0.013529582\\n"
|
||||||
|
|
@ -287,7 +287,7 @@ embedded_instances {
|
||||||
" index: 3\\n"
|
" index: 3\\n"
|
||||||
" count: 3\\n"
|
" count: 3\\n"
|
||||||
" }\\n"
|
" }\\n"
|
||||||
" data: 201.29485\\n"
|
" data: 215.48624\\n"
|
||||||
" data: 10.0\\n"
|
" data: 10.0\\n"
|
||||||
" data: 10.0\\n"
|
" data: 10.0\\n"
|
||||||
" data: 131.92336\\n"
|
" data: 131.92336\\n"
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ function init(self)
|
||||||
msg.post("level2:/pause#sprite", "disable")
|
msg.post("level2:/pause#sprite", "disable")
|
||||||
msg.post("/player#player", "level2")
|
msg.post("/player#player", "level2")
|
||||||
msg.post("main:/controller#main", "play background music")
|
msg.post("main:/controller#main", "play background music")
|
||||||
|
msg.post("/mummy#mummy", "creator", { creator = msg.url() })
|
||||||
print("level2")
|
print("level2")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -122,6 +123,18 @@ function on_message(self, message_id, message, sender)
|
||||||
end
|
end
|
||||||
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
||||||
end
|
end
|
||||||
|
if message_id == hash("manual_pause") then
|
||||||
|
if not self.paused then
|
||||||
|
self.paused = true
|
||||||
|
-- msg.post("/pause#sprite", "enable")
|
||||||
|
-- msg.post("/player#player", "pause")
|
||||||
|
for i, id in ipairs(self.curses) do
|
||||||
|
local id_url = msg.url(id)
|
||||||
|
msg.post(id_url, "pause")
|
||||||
|
end
|
||||||
|
self.won = true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
|
|
|
||||||
|
|
@ -981,6 +981,8 @@ embedded_instances {
|
||||||
"mask: \\\"curse\\\"\\n"
|
"mask: \\\"curse\\\"\\n"
|
||||||
"mask: \\\"amulet\\\"\\n"
|
"mask: \\\"amulet\\\"\\n"
|
||||||
"mask: \\\"mummy\\\"\\n"
|
"mask: \\\"mummy\\\"\\n"
|
||||||
|
"mask: \\\"key\\\"\\n"
|
||||||
|
"mask: \\\"chest\\\"\\n"
|
||||||
"embedded_collision_shape {\\n"
|
"embedded_collision_shape {\\n"
|
||||||
" shapes {\\n"
|
" shapes {\\n"
|
||||||
" shape_type: TYPE_BOX\\n"
|
" shape_type: TYPE_BOX\\n"
|
||||||
|
|
@ -1661,3 +1663,290 @@ embedded_instances {
|
||||||
"}\n"
|
"}\n"
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
|
embedded_instances {
|
||||||
|
id: "chest"
|
||||||
|
data: "embedded_components {\n"
|
||||||
|
" id: \"sprite\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"closed chest\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 1021.0\n"
|
||||||
|
" y: 566.0\n"
|
||||||
|
" z: 0.1\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.08\n"
|
||||||
|
" y: 0.08\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"embedded_components {\n"
|
||||||
|
" id: \"sprite1\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"pixel chest\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 1020.0\n"
|
||||||
|
" y: 573.0\n"
|
||||||
|
" z: 0.2\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.09\n"
|
||||||
|
" y: 0.09\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"embedded_components {\n"
|
||||||
|
" id: \"collisionobject\"\n"
|
||||||
|
" type: \"collisionobject\"\n"
|
||||||
|
" data: \"type: COLLISION_OBJECT_TYPE_KINEMATIC\\n"
|
||||||
|
"mass: 0.0\\n"
|
||||||
|
"friction: 0.1\\n"
|
||||||
|
"restitution: 0.5\\n"
|
||||||
|
"group: \\\"chest\\\"\\n"
|
||||||
|
"mask: \\\"player\\\"\\n"
|
||||||
|
"embedded_collision_shape {\\n"
|
||||||
|
" shapes {\\n"
|
||||||
|
" shape_type: TYPE_BOX\\n"
|
||||||
|
" position {\\n"
|
||||||
|
" x: 1019.0\\n"
|
||||||
|
" y: 572.0\\n"
|
||||||
|
" }\\n"
|
||||||
|
" rotation {\\n"
|
||||||
|
" }\\n"
|
||||||
|
" index: 0\\n"
|
||||||
|
" count: 3\\n"
|
||||||
|
" }\\n"
|
||||||
|
" data: 29.086132\\n"
|
||||||
|
" data: 30.405022\\n"
|
||||||
|
" data: 10.0\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
"}\n"
|
||||||
|
""
|
||||||
|
}
|
||||||
|
embedded_instances {
|
||||||
|
id: "key"
|
||||||
|
data: "embedded_components {\n"
|
||||||
|
" id: \"sprite\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"key\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 971.0\n"
|
||||||
|
" y: 196.0\n"
|
||||||
|
" z: 0.1\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.05\n"
|
||||||
|
" y: 0.05\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"embedded_components {\n"
|
||||||
|
" id: \"collisionobject\"\n"
|
||||||
|
" type: \"collisionobject\"\n"
|
||||||
|
" data: \"type: COLLISION_OBJECT_TYPE_KINEMATIC\\n"
|
||||||
|
"mass: 0.0\\n"
|
||||||
|
"friction: 0.1\\n"
|
||||||
|
"restitution: 0.5\\n"
|
||||||
|
"group: \\\"key\\\"\\n"
|
||||||
|
"mask: \\\"player\\\"\\n"
|
||||||
|
"embedded_collision_shape {\\n"
|
||||||
|
" shapes {\\n"
|
||||||
|
" shape_type: TYPE_BOX\\n"
|
||||||
|
" position {\\n"
|
||||||
|
" x: 971.0\\n"
|
||||||
|
" y: 196.0\\n"
|
||||||
|
" }\\n"
|
||||||
|
" rotation {\\n"
|
||||||
|
" }\\n"
|
||||||
|
" index: 0\\n"
|
||||||
|
" count: 3\\n"
|
||||||
|
" }\\n"
|
||||||
|
" data: 10.944113\\n"
|
||||||
|
" data: 21.498772\\n"
|
||||||
|
" data: 10.0\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
"}\n"
|
||||||
|
""
|
||||||
|
}
|
||||||
|
embedded_instances {
|
||||||
|
id: "won"
|
||||||
|
data: "embedded_components {\n"
|
||||||
|
" id: \"sprite\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"you\\\\\\\'ve won\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 376.0\n"
|
||||||
|
" y: 334.0\n"
|
||||||
|
" z: 0.9\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
""
|
||||||
|
}
|
||||||
|
embedded_instances {
|
||||||
|
id: "key_symbol"
|
||||||
|
data: "embedded_components {\n"
|
||||||
|
" id: \"sprite\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"key\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 1012.0\n"
|
||||||
|
" y: 653.0\n"
|
||||||
|
" z: 0.2\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.05\n"
|
||||||
|
" y: 0.05\n"
|
||||||
|
" z: 2.12\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
""
|
||||||
|
}
|
||||||
|
embedded_instances {
|
||||||
|
id: "mummy_explosion"
|
||||||
|
data: "embedded_components {\n"
|
||||||
|
" id: \"sprite\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"explosion\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 932.0\n"
|
||||||
|
" y: 603.0\n"
|
||||||
|
" z: 0.1\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.3\n"
|
||||||
|
" y: 0.3\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"embedded_components {\n"
|
||||||
|
" id: \"sprite1\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"explosion\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"size {\\n"
|
||||||
|
" x: 202.0\\n"
|
||||||
|
" y: 202.0\\n"
|
||||||
|
"}\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 894.0\n"
|
||||||
|
" y: 638.0\n"
|
||||||
|
" z: 0.1\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.3\n"
|
||||||
|
" y: 0.3\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"embedded_components {\n"
|
||||||
|
" id: \"sprite2\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"explosion\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"size {\\n"
|
||||||
|
" x: 202.0\\n"
|
||||||
|
" y: 202.0\\n"
|
||||||
|
"}\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 949.0\n"
|
||||||
|
" y: 651.0\n"
|
||||||
|
" z: 0.1\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.3\n"
|
||||||
|
" y: 0.3\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"embedded_components {\n"
|
||||||
|
" id: \"sprite3\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"explosion\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"size {\\n"
|
||||||
|
" x: 202.0\\n"
|
||||||
|
" y: 202.0\\n"
|
||||||
|
"}\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 885.0\n"
|
||||||
|
" y: 565.0\n"
|
||||||
|
" z: 0.1\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.3\n"
|
||||||
|
" y: 0.3\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"embedded_components {\n"
|
||||||
|
" id: \"sprite4\"\n"
|
||||||
|
" type: \"sprite\"\n"
|
||||||
|
" data: \"default_animation: \\\"explosion\\\"\\n"
|
||||||
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
|
"size {\\n"
|
||||||
|
" x: 202.0\\n"
|
||||||
|
" y: 202.0\\n"
|
||||||
|
"}\\n"
|
||||||
|
"textures {\\n"
|
||||||
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
|
"}\\n"
|
||||||
|
"\"\n"
|
||||||
|
" position {\n"
|
||||||
|
" x: 951.0\n"
|
||||||
|
" y: 569.0\n"
|
||||||
|
" z: 0.1\n"
|
||||||
|
" }\n"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 0.3\n"
|
||||||
|
" y: 0.3\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
""
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,20 @@ function init(self)
|
||||||
self.mummy_timer = 0
|
self.mummy_timer = 0
|
||||||
self.paused = false
|
self.paused = false
|
||||||
|
|
||||||
|
self.won = false
|
||||||
|
self.won_sprite_timer = 2
|
||||||
|
self.won_timer = 3
|
||||||
|
|
||||||
createamulets(self)
|
createamulets(self)
|
||||||
msg.post("level3:/pause#sprite", "disable")
|
msg.post("level3:/pause#sprite", "disable")
|
||||||
msg.post("/player#player", "level3")
|
msg.post("/player#player", "level3")
|
||||||
msg.post("main:/controller#main", "play background music")
|
msg.post("main:/controller#main", "play background music")
|
||||||
print("level3")
|
print("level3")
|
||||||
|
msg.post("chest#sprite1", "disable")
|
||||||
|
msg.post("won#sprite", "disable")
|
||||||
|
msg.post("key_symbol#sprite", "disable")
|
||||||
|
msg.post("mummy_explosion", "disable")
|
||||||
|
msg.post("/mummy#mummy", "creator", { creator = msg.url() })
|
||||||
end
|
end
|
||||||
|
|
||||||
function createamulets(self)
|
function createamulets(self)
|
||||||
|
|
@ -78,6 +87,17 @@ function update(self, dt)
|
||||||
self.curse_count = self.curse_count + 1
|
self.curse_count = self.curse_count + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if self.won == true then
|
||||||
|
self.won_timer = self.won_timer - dt
|
||||||
|
if self.won_timer <= 0 then
|
||||||
|
msg.post("won#sprite", "enable")
|
||||||
|
msg.post("mummy_explosion", "disable")
|
||||||
|
self.won_sprite_timer = self.won_sprite_timer - dt
|
||||||
|
if self.won_sprite_timer <= 0 then
|
||||||
|
msg.post("main:/controller#main", "NoMoreLives")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function fixed_update(self, dt)
|
function fixed_update(self, dt)
|
||||||
|
|
@ -122,6 +142,18 @@ function on_message(self, message_id, message, sender)
|
||||||
end
|
end
|
||||||
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
||||||
end
|
end
|
||||||
|
if message_id == hash("manual_pause") then
|
||||||
|
if not self.paused then
|
||||||
|
self.paused = true
|
||||||
|
-- msg.post("/pause#sprite", "enable")
|
||||||
|
-- msg.post("/player#player", "pause")
|
||||||
|
for i, id in ipairs(self.curses) do
|
||||||
|
local id_url = msg.url(id)
|
||||||
|
msg.post(id_url, "pause")
|
||||||
|
end
|
||||||
|
self.won = true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,9 @@ function init(self)
|
||||||
msg.post(".", "acquire_input_focus")
|
msg.post(".", "acquire_input_focus")
|
||||||
-- show the title screen when the game is loaded
|
-- show the title screen when the game is loaded
|
||||||
|
|
||||||
-- msg.post("#startscreen_proxy", "load")
|
msg.post("#startscreen_proxy", "load")
|
||||||
msg.post("#level3prescreen_proxy", "load")
|
|
||||||
self.collection_to_load = ""
|
self.collection_to_load = ""
|
||||||
-- self.current_collection = "#startscreen_proxy"
|
self.current_collection = "#startscreen_proxy"
|
||||||
self.current_collection = "#level3prescreen_proxy"
|
|
||||||
|
|
||||||
|
|
||||||
--msg.post("#level2_proxy", "load")
|
--msg.post("#level2_proxy", "load")
|
||||||
|
|
@ -125,6 +123,7 @@ function on_message(self, message_id, message, sender)
|
||||||
elseif message_id == hash("escape") then
|
elseif message_id == hash("escape") then
|
||||||
msg.post(self.current_collection, "unload")
|
msg.post(self.current_collection, "unload")
|
||||||
self.collection_to_load = "#startscreen_proxy"
|
self.collection_to_load = "#startscreen_proxy"
|
||||||
|
self.hide_banner = true
|
||||||
|
|
||||||
elseif message_id == hash("show level1prescreen") then
|
elseif message_id == hash("show level1prescreen") then
|
||||||
msg.post(self.current_collection, "unload")
|
msg.post(self.current_collection, "unload")
|
||||||
|
|
@ -180,6 +179,12 @@ function on_message(self, message_id, message, sender)
|
||||||
self.current_score = self.current_score + 100
|
self.current_score = self.current_score + 100
|
||||||
--print(self.current_score)
|
--print(self.current_score)
|
||||||
|
|
||||||
|
elseif message_id == hash("add 500 points") then
|
||||||
|
self.current_score = self.current_score + 500
|
||||||
|
|
||||||
|
elseif message_id == hash("add 1000 points") then
|
||||||
|
self.current_score = self.current_score + 1000
|
||||||
|
|
||||||
elseif message_id == hash("play amulet sound") then
|
elseif message_id == hash("play amulet sound") then
|
||||||
sound.play("sound#amulet_sound", {speed = 1, gain = (self.sounds_volume - 547)/(887 - 547)})
|
sound.play("sound#amulet_sound", {speed = 1, gain = (self.sounds_volume - 547)/(887 - 547)})
|
||||||
elseif message_id == hash("play dying sound") then
|
elseif message_id == hash("play dying sound") then
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ function update(self, dt)
|
||||||
self.velocity.y = self.velocity.y + self.gravity * dt
|
self.velocity.y = self.velocity.y + self.gravity * dt
|
||||||
end
|
end
|
||||||
go.set_position(pos)
|
go.set_position(pos)
|
||||||
|
if pos.x >= 1100 then
|
||||||
|
msg.post("main:/controller#main", "LevelCompleted")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function fixed_update(self, dt)
|
function fixed_update(self, dt)
|
||||||
|
|
@ -51,9 +54,25 @@ end
|
||||||
|
|
||||||
function on_message(self, message_id, message, sender)
|
function on_message(self, message_id, message, sender)
|
||||||
if message_id == hash("explode") then
|
if message_id == hash("explode") then
|
||||||
sprite.play_flipbook("#still", hash("explosion"))
|
msg.post("level3:/controller#level3", "manual_pause")
|
||||||
|
go.delete("mummy")
|
||||||
|
-- sprite.play_flipbook("#still", hash("explosion"))
|
||||||
|
-- msg.post(self.creator, "mummy_deleted")
|
||||||
--msg.post("mummy", "disable")
|
--msg.post("mummy", "disable")
|
||||||
end
|
end
|
||||||
|
if message_id == hash("play_anim") then
|
||||||
|
sprite.play_flipbook("/mummy#still", "walking_mummy")
|
||||||
|
local flip_y = vmath.quat_rotation_y(math.rad(180))
|
||||||
|
go.set_rotation(flip_y)
|
||||||
|
go.set_scale(vmath.vector3(1.3, 1.3, 1))
|
||||||
|
self.velocity.x = 250
|
||||||
|
msg.post(self.creator, "manual_pause")
|
||||||
|
print("creator = " .. self.creator)
|
||||||
|
end
|
||||||
|
if message_id == hash("creator") then
|
||||||
|
self.creator = message.creator
|
||||||
|
print("creator set for mummy = " .. self.creator)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,12 @@ function init(self)
|
||||||
|
|
||||||
self.current_movement = Movement.STILL_RIGHT
|
self.current_movement = Movement.STILL_RIGHT
|
||||||
self.current_level = "level1"
|
self.current_level = "level1"
|
||||||
|
|
||||||
|
self.holding_key = false
|
||||||
|
self.scored = false
|
||||||
|
|
||||||
|
self.mummy_walking = false
|
||||||
|
self.touching_mummy = false
|
||||||
go.set_position(vmath.vector3(100,100,0.2))
|
go.set_position(vmath.vector3(100,100,0.2))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -372,13 +377,45 @@ function on_message(self, message_id, message, sender)
|
||||||
msg.post("main:/controller#main", "play amulet sound")
|
msg.post("main:/controller#main", "play amulet sound")
|
||||||
end
|
end
|
||||||
if message.group == hash("mummy") then
|
if message.group == hash("mummy") then
|
||||||
msg.post("main:/controller#main", "LevelCompleted")
|
-- sprite.play_flipbook("/mummy#still", "walking_mummy")
|
||||||
msg.post("main:/controller#main", "play mummy sound")
|
if self.touching_mummy == false then
|
||||||
|
self.mummy_walking = true
|
||||||
|
msg.post("mummy#mummy", "play_anim")
|
||||||
|
self.touching_mummy = true
|
||||||
|
end
|
||||||
|
if self.mummy_walking == false then
|
||||||
|
msg.post("main:/controller#main", "LevelCompleted")
|
||||||
|
msg.post("main:/controller#main", "play mummy sound")
|
||||||
|
end
|
||||||
--print("collision with mummy")
|
--print("collision with mummy")
|
||||||
if self.current_level == "level3" then
|
if self.current_level == "level3" then
|
||||||
msg.post("/mummy#mummy", "explode")
|
msg.post("/mummy#mummy", "explode")
|
||||||
|
msg.post("mummy_explosion", "enable")
|
||||||
|
msg.post("main:/controller#main", "add 500 points")
|
||||||
|
print("500")
|
||||||
|
if self.holding_key == true then
|
||||||
|
msg.post("chest#sprite1", "enable")
|
||||||
|
msg.post("chest#sprite", "disable")
|
||||||
|
if self.scored == false then
|
||||||
|
msg.post("main:/controller#main", "add 1000 points")
|
||||||
|
print("1000")
|
||||||
|
self.scored = true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- if message.group == hash("chest") then
|
||||||
|
-- if self.holding_key == true then
|
||||||
|
-- msg.post("chest#sprite1", "enable")
|
||||||
|
-- msg.post("chest#sprite", "disable")
|
||||||
|
-- msg.post("main:/controller#main", "add 1000 points")
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
if message.group == hash("key") then
|
||||||
|
self.holding_key = true
|
||||||
|
msg.post("level3:/key#sprite", "disable")
|
||||||
|
msg.post("key_symbol#sprite", "enable")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if message_id == hash("curse_dying_reply") then
|
if message_id == hash("curse_dying_reply") then
|
||||||
if message.dying == false then
|
if message.dying == false then
|
||||||
|
|
|
||||||
|
|
@ -40,20 +40,13 @@ embedded_instances {
|
||||||
"embedded_components {\n"
|
"embedded_components {\n"
|
||||||
" id: \"cloud1\"\n"
|
" id: \"cloud1\"\n"
|
||||||
" type: \"sprite\"\n"
|
" type: \"sprite\"\n"
|
||||||
" data: \"default_animation: \\\"cloud1\\\"\\n"
|
" data: \"default_animation: \\\"cloud\\\"\\n"
|
||||||
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||||
"textures {\\n"
|
"textures {\\n"
|
||||||
" sampler: \\\"texture_sampler\\\"\\n"
|
" sampler: \\\"texture_sampler\\\"\\n"
|
||||||
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||||
"}\\n"
|
"}\\n"
|
||||||
"\"\n"
|
"\"\n"
|
||||||
" position {\n"
|
|
||||||
" z: 0.4\n"
|
|
||||||
" }\n"
|
|
||||||
" scale {\n"
|
|
||||||
" x: 1.295998\n"
|
|
||||||
" y: 1.368312\n"
|
|
||||||
" }\n"
|
|
||||||
"}\n"
|
"}\n"
|
||||||
""
|
""
|
||||||
scale3 {
|
scale3 {
|
||||||
|
|
|
||||||