chest and key
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
:code {
|
||||
:find {
|
||||
:term ""
|
||||
:term "LifeLost"
|
||||
}
|
||||
}
|
||||
:search-in-files {
|
||||
|
|
@ -9,10 +9,6 @@
|
|||
}
|
||||
:workflow {
|
||||
:recent-files [
|
||||
[
|
||||
"/main/entername.gui"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/entername.gui_script"
|
||||
:code
|
||||
|
|
@ -25,10 +21,6 @@
|
|||
"/main/scoreboard.gui_script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/level2.collection"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/settings.gui"
|
||||
:scene
|
||||
|
|
@ -45,14 +37,6 @@
|
|||
"/main/button.gui_script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/level2.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/level3.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/entername.script"
|
||||
:code
|
||||
|
|
@ -85,10 +69,6 @@
|
|||
"/main/level2prescreen_copy.collection"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/level1.collection"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/settings.gui_script"
|
||||
:code
|
||||
|
|
@ -97,22 +77,6 @@
|
|||
"/main/main.collection"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/main.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/player.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/amulet.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/level1.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/holdingamulet.script"
|
||||
:code
|
||||
|
|
@ -122,21 +86,57 @@
|
|||
:scene
|
||||
]
|
||||
[
|
||||
"/main/curse.script"
|
||||
:code
|
||||
"/main/level3.collection"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/graphics.atlas"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/startscreen.collection"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/level1.collection"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/player.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/amulet.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/main.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/mummy.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/level3.collection"
|
||||
"/main/curse.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/level1.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/level2.script"
|
||||
:code
|
||||
]
|
||||
[
|
||||
"/main/level2.collection"
|
||||
:scene
|
||||
]
|
||||
[
|
||||
"/main/level3.script"
|
||||
:code
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
|
||||
‡A
|
||||
ñ@function init(self)
|
||||
êB
|
||||
ÔBfunction init(self)
|
||||
msg.post(".", "acquire_input_focus")
|
||||
-- show the title screen when the game is loaded
|
||||
|
||||
-- msg.post("#startscreen_proxy", "load")
|
||||
msg.post("#level3prescreen_proxy", "load")
|
||||
msg.post("#startscreen_proxy", "load")
|
||||
-- msg.post("#level3prescreen_proxy", "load")
|
||||
self.collection_to_load = ""
|
||||
-- self.current_collection = "#startscreen_proxy"
|
||||
self.current_collection = "#level3prescreen_proxy"
|
||||
self.current_collection = "#startscreen_proxy"
|
||||
-- self.current_collection = "#level3prescreen_proxy"
|
||||
|
||||
|
||||
--msg.post("#level2_proxy", "load")
|
||||
|
|
@ -127,6 +127,7 @@ function on_message(self, message_id, message, sender)
|
|||
elseif message_id == hash("escape") then
|
||||
msg.post(self.current_collection, "unload")
|
||||
self.collection_to_load = "#startscreen_proxy"
|
||||
self.hide_banner = true
|
||||
|
||||
elseif message_id == hash("show level1prescreen") then
|
||||
msg.post(self.current_collection, "unload")
|
||||
|
|
@ -182,6 +183,12 @@ function on_message(self, message_id, message, sender)
|
|||
self.current_score = self.current_score + 100
|
||||
--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
|
||||
sound.play("sound#amulet_sound", {speed = 1, gain = (self.sounds_volume - 547)/(887 - 547)})
|
||||
elseif message_id == hash("play dying sound") then
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
™z
|
||||
<EFBFBD>zlocal Movement = {
|
||||
œƒ
|
||||
ƒƒlocal Movement = {
|
||||
STILL_LEFT = "STILL_LEFT",
|
||||
STILL_RIGHT = "STILL_RIGHT",
|
||||
MOVING_LEFT = "MOVING_LEFT",
|
||||
|
|
@ -125,6 +125,11 @@ function init(self)
|
|||
self.current_movement = Movement.STILL_RIGHT
|
||||
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))
|
||||
end
|
||||
|
||||
|
|
@ -374,14 +379,46 @@ function on_message(self, message_id, message, sender)
|
|||
msg.post("main:/controller#main", "play amulet sound")
|
||||
end
|
||||
if message.group == hash("mummy") then
|
||||
-- sprite.play_flipbook("/mummy#still", "walking_mummy")
|
||||
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")
|
||||
if self.current_level == "level3" then
|
||||
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
|
||||
-- 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
|
||||
if message_id == hash("curse_dying_reply") then
|
||||
if message.dying == false then
|
||||
msg.post("/holding_amulet#holdingamulet", "disable_sprite")
|
||||
|
|
|
|||
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 {
|
||||
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 {
|
||||
id: "run_left"
|
||||
images {
|
||||
|
|
@ -235,4 +250,21 @@ animations {
|
|||
}
|
||||
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
|
||||
|
|
|
|||
|
|
@ -604,6 +604,9 @@ embedded_instances {
|
|||
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||
"}\\n"
|
||||
"\"\n"
|
||||
" position {\n"
|
||||
" z: 0.1\n"
|
||||
" }\n"
|
||||
" scale {\n"
|
||||
" x: -0.4\n"
|
||||
" y: 0.4\n"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ function init(self)
|
|||
msg.post("level1:/pause#sprite", "disable")
|
||||
msg.post("/player#player", "level1")
|
||||
msg.post("main:/controller#main", "play background music")
|
||||
msg.post("/mummy#mummy", "creator", { creator = msg.url() })
|
||||
print("level1")
|
||||
end
|
||||
|
||||
|
|
@ -122,6 +123,18 @@ function on_message(self, message_id, message, sender)
|
|||
end
|
||||
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
||||
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
|
||||
|
||||
function on_input(self, action_id, action)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ function init(self)
|
|||
msg.post("level2:/pause#sprite", "disable")
|
||||
msg.post("/player#player", "level2")
|
||||
msg.post("main:/controller#main", "play background music")
|
||||
msg.post("/mummy#mummy", "creator", { creator = msg.url() })
|
||||
print("level2")
|
||||
end
|
||||
|
||||
|
|
@ -122,6 +123,18 @@ function on_message(self, message_id, message, sender)
|
|||
end
|
||||
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
||||
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
|
||||
|
||||
function on_input(self, action_id, action)
|
||||
|
|
|
|||
|
|
@ -981,6 +981,8 @@ embedded_instances {
|
|||
"mask: \\\"curse\\\"\\n"
|
||||
"mask: \\\"amulet\\\"\\n"
|
||||
"mask: \\\"mummy\\\"\\n"
|
||||
"mask: \\\"key\\\"\\n"
|
||||
"mask: \\\"chest\\\"\\n"
|
||||
"embedded_collision_shape {\\n"
|
||||
" shapes {\\n"
|
||||
" shape_type: TYPE_BOX\\n"
|
||||
|
|
@ -1661,3 +1663,290 @@ embedded_instances {
|
|||
"}\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,19 @@ function init(self)
|
|||
self.mummy_timer = 0
|
||||
self.paused = false
|
||||
|
||||
self.won = false
|
||||
self.won_sprite_timer = 2
|
||||
self.won_timer = 3
|
||||
|
||||
createamulets(self)
|
||||
msg.post("level3:/pause#sprite", "disable")
|
||||
msg.post("/player#player", "level3")
|
||||
msg.post("main:/controller#main", "play background music")
|
||||
print("level3")
|
||||
msg.post("chest#sprite1", "disable")
|
||||
msg.post("won#sprite", "disable")
|
||||
msg.post("key_symbol#sprite", "disable")
|
||||
msg.post("mummy_explosion", "disable")
|
||||
end
|
||||
|
||||
function createamulets(self)
|
||||
|
|
@ -78,6 +86,17 @@ function update(self, dt)
|
|||
self.curse_count = self.curse_count + 1
|
||||
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
|
||||
|
||||
function fixed_update(self, dt)
|
||||
|
|
@ -122,6 +141,18 @@ function on_message(self, message_id, message, sender)
|
|||
end
|
||||
--print ("Amulet removed, we now have " .. self.amulet_count .. " amulets left")
|
||||
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
|
||||
|
||||
function on_input(self, action_id, action)
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ function init(self)
|
|||
msg.post(".", "acquire_input_focus")
|
||||
-- show the title screen when the game is loaded
|
||||
|
||||
-- msg.post("#startscreen_proxy", "load")
|
||||
msg.post("#level3prescreen_proxy", "load")
|
||||
msg.post("#startscreen_proxy", "load")
|
||||
-- msg.post("#level3prescreen_proxy", "load")
|
||||
self.collection_to_load = ""
|
||||
-- self.current_collection = "#startscreen_proxy"
|
||||
self.current_collection = "#level3prescreen_proxy"
|
||||
self.current_collection = "#startscreen_proxy"
|
||||
-- self.current_collection = "#level3prescreen_proxy"
|
||||
|
||||
|
||||
--msg.post("#level2_proxy", "load")
|
||||
|
|
@ -125,6 +125,7 @@ function on_message(self, message_id, message, sender)
|
|||
elseif message_id == hash("escape") then
|
||||
msg.post(self.current_collection, "unload")
|
||||
self.collection_to_load = "#startscreen_proxy"
|
||||
self.hide_banner = true
|
||||
|
||||
elseif message_id == hash("show level1prescreen") then
|
||||
msg.post(self.current_collection, "unload")
|
||||
|
|
@ -180,6 +181,12 @@ function on_message(self, message_id, message, sender)
|
|||
self.current_score = self.current_score + 100
|
||||
--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
|
||||
sound.play("sound#amulet_sound", {speed = 1, gain = (self.sounds_volume - 547)/(887 - 547)})
|
||||
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
|
||||
end
|
||||
go.set_position(pos)
|
||||
if pos.x >= 1100 then
|
||||
msg.post("main:/controller#main", "LevelCompleted")
|
||||
end
|
||||
end
|
||||
|
||||
function fixed_update(self, dt)
|
||||
|
|
@ -51,9 +54,23 @@ end
|
|||
|
||||
function on_message(self, message_id, message, sender)
|
||||
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")
|
||||
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")
|
||||
end
|
||||
if message_id == hash("creator") then
|
||||
self.creator = message.creator
|
||||
end
|
||||
end
|
||||
|
||||
function on_input(self, action_id, action)
|
||||
|
|
|
|||
|
|
@ -123,6 +123,11 @@ function init(self)
|
|||
self.current_movement = Movement.STILL_RIGHT
|
||||
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))
|
||||
end
|
||||
|
||||
|
|
@ -372,14 +377,46 @@ function on_message(self, message_id, message, sender)
|
|||
msg.post("main:/controller#main", "play amulet sound")
|
||||
end
|
||||
if message.group == hash("mummy") then
|
||||
-- sprite.play_flipbook("/mummy#still", "walking_mummy")
|
||||
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")
|
||||
if self.current_level == "level3" then
|
||||
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
|
||||
-- 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
|
||||
if message_id == hash("curse_dying_reply") then
|
||||
if message.dying == false then
|
||||
msg.post("/holding_amulet#holdingamulet", "disable_sprite")
|
||||
|
|
|
|||
|
|
@ -40,20 +40,13 @@ embedded_instances {
|
|||
"embedded_components {\n"
|
||||
" id: \"cloud1\"\n"
|
||||
" type: \"sprite\"\n"
|
||||
" data: \"default_animation: \\\"cloud1\\\"\\n"
|
||||
" data: \"default_animation: \\\"cloud\\\"\\n"
|
||||
"material: \\\"/builtins/materials/sprite.material\\\"\\n"
|
||||
"textures {\\n"
|
||||
" sampler: \\\"texture_sampler\\\"\\n"
|
||||
" texture: \\\"/main/graphics.atlas\\\"\\n"
|
||||
"}\\n"
|
||||
"\"\n"
|
||||
" position {\n"
|
||||
" z: 0.4\n"
|
||||
" }\n"
|
||||
" scale {\n"
|
||||
" x: 1.295998\n"
|
||||
" y: 1.368312\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
""
|
||||
scale3 {
|
||||
|
|
|
|||