diff --git a/graphics/Gameover.png b/graphics/Gameover.png new file mode 100644 index 0000000..b073f14 Binary files /dev/null and b/graphics/Gameover.png differ diff --git a/graphics/cloudleft.png b/graphics/cloudleft.png new file mode 100644 index 0000000..46c4661 Binary files /dev/null and b/graphics/cloudleft.png differ diff --git a/graphics/cloudright.png b/graphics/cloudright.png new file mode 100644 index 0000000..3793d8f Binary files /dev/null and b/graphics/cloudright.png differ diff --git a/graphics/startscreennew.png b/graphics/startscreennew.png new file mode 100644 index 0000000..6f68e41 Binary files /dev/null and b/graphics/startscreennew.png differ diff --git a/graphics/title.png b/graphics/title.png new file mode 100644 index 0000000..ca3e7fe Binary files /dev/null and b/graphics/title.png differ diff --git a/main/cloudleft.script b/main/cloudleft.script new file mode 100644 index 0000000..a4de810 --- /dev/null +++ b/main/cloudleft.script @@ -0,0 +1,56 @@ +local cloud_speed = 50 -- pixels per second + +function init(self) + msg.post(".", "acquire_input_focus") + go.set_position(vmath.vector3(50,542,0)) +-- sprite.set_constant("#cloud2", "tint", vmath.vector4(1, 1, 1, 0.9)) +end + +function final(self) + -- Add finalization code here + -- Learn more: https://defold.com/manuals/script/ + -- Remove this function if not needed +end + +function update(self, dt) + local pos = go.get_position("cloud2") + pos.x = pos.x - cloud_speed * dt + + if pos.x < -467 then -- assuming cloud width is ~64px + pos.x = 1055+467; + end + go.set_position(pos) +end + +function fixed_update(self, dt) + -- This function is called if 'Fixed Update Frequency' is enabled in the Engine section of game.project + -- Can be coupled with fixed updates of the physics simulation if 'Use Fixed Timestep' is enabled in + -- Physics section of game.project + -- Add update code here + -- Learn more: https://defold.com/manuals/script/ + -- Remove this function if not needed +end + +function on_message(self, message_id, message, sender) + -- Add message-handling code here + -- Learn more: https://defold.com/manuals/message-passing/ + -- Remove this function if not needed +end + +function on_input(self, action_id, action) + -- Add input-handling code here. The game object this script is attached to + -- must have acquired input focus: + -- + -- msg.post(".", "acquire_input_focus") + -- + -- All mapped input bindings will be received. Mouse and touch input will + -- be received regardless of where on the screen it happened. + -- Learn more: https://defold.com/manuals/input/ + -- Remove this function if not needed +end + +function on_reload(self) + -- Add reload-handling code here + -- Learn more: https://defold.com/manuals/hot-reload/ + -- Remove this function if not needed +end diff --git a/main/clouds.script b/main/clouds.script index 45638da..1571950 100644 --- a/main/clouds.script +++ b/main/clouds.script @@ -2,8 +2,8 @@ local cloud_speed = 50 -- pixels per second function init(self) msg.post(".", "acquire_input_focus") - go.set_position(vmath.vector3(1055+390,542,0)) - sprite.set_constant("#cloud1", "tint", vmath.vector4(1, 1, 1, 0.7)) + go.set_position(vmath.vector3(1055,542,0)) +-- sprite.set_constant("#cloud1", "tint", vmath.vector4(1, 1, 1, 0.9)) end function final(self) @@ -16,8 +16,8 @@ function update(self, dt) local pos = go.get_position("cloud1") pos.x = pos.x - cloud_speed * dt - if pos.x < -390 then -- assuming cloud width is ~64px - pos.x = 1055+390; + if pos.x < -467 then -- assuming cloud width is ~64px + pos.x = 1055+467; end go.set_position(pos) end diff --git a/main/curse.script b/main/curse.script index b6b8df6..6c38892 100644 --- a/main/curse.script +++ b/main/curse.script @@ -106,7 +106,7 @@ function on_message(self, message_id, message, sender) if message.group == hash("curse_jump_pads") then print("Oh yeah!") self.velocity.y = 150 - self.speed = 550 + self.speed = 590 end end if message_id == hash("visible") then diff --git a/main/gameover.collection b/main/gameover.collection index b6bef7f..146d502 100644 --- a/main/gameover.collection +++ b/main/gameover.collection @@ -9,13 +9,17 @@ embedded_instances { "embedded_components {\n" " id: \"sprite\"\n" " type: \"sprite\"\n" - " data: \"default_animation: \\\"GameOverScreen\\\"\\n" + " data: \"default_animation: \\\"Gameover\\\"\\n" "material: \\\"/builtins/materials/sprite.material\\\"\\n" "textures {\\n" " sampler: \\\"texture_sampler\\\"\\n" " texture: \\\"/main/graphics.atlas\\\"\\n" "}\\n" "\"\n" + " scale {\n" + " x: 1.0624\n" + " y: 1.0576\n" + " }\n" "}\n" "" scale3 { diff --git a/main/graphics.atlas b/main/graphics.atlas index 5e4bf56..6c6b377 100644 --- a/main/graphics.atlas +++ b/main/graphics.atlas @@ -127,6 +127,21 @@ images { images { image: "/graphics/cloud.png" } +images { + image: "/graphics/cloudleft.png" +} +images { + image: "/graphics/cloudright.png" +} +images { + image: "/graphics/title.png" +} +images { + image: "/graphics/startscreennew.png" +} +images { + image: "/graphics/Gameover.png" +} animations { id: "run_left" images { diff --git a/main/startscreen.collection b/main/startscreen.collection index fdce3d3..326bd5a 100644 --- a/main/startscreen.collection +++ b/main/startscreen.collection @@ -5,7 +5,7 @@ embedded_instances { data: "embedded_components {\n" " id: \"sprite\"\n" " type: \"sprite\"\n" - " data: \"default_animation: \\\"startscreen\\\"\\n" + " data: \"default_animation: \\\"startscreennew\\\"\\n" "material: \\\"/builtins/materials/sprite.material\\\"\\n" "textures {\\n" " sampler: \\\"texture_sampler\\\"\\n" @@ -17,8 +17,28 @@ embedded_instances { " y: 344.0\n" " }\n" " scale {\n" - " x: 0.9915\n" - " y: 0.99\n" + " x: 1.0956\n" + " y: 1.1012658\n" + " }\n" + "}\n" + "embedded_components {\n" + " id: \"sprite1\"\n" + " type: \"sprite\"\n" + " data: \"default_animation: \\\"title\\\"\\n" + "material: \\\"/builtins/materials/sprite.material\\\"\\n" + "textures {\\n" + " sampler: \\\"texture_sampler\\\"\\n" + " texture: \\\"/main/graphics.atlas\\\"\\n" + "}\\n" + "\"\n" + " position {\n" + " x: 554.0\n" + " y: 498.0\n" + " z: 1.0\n" + " }\n" + " scale {\n" + " x: 1.33\n" + " y: 1.33\n" " }\n" "}\n" "" @@ -40,7 +60,7 @@ embedded_instances { "embedded_components {\n" " id: \"cloud1\"\n" " type: \"sprite\"\n" - " data: \"default_animation: \\\"cloud\\\"\\n" + " data: \"default_animation: \\\"cloudright\\\"\\n" "material: \\\"/builtins/materials/sprite.material\\\"\\n" "textures {\\n" " sampler: \\\"texture_sampler\\\"\\n" @@ -54,3 +74,30 @@ embedded_instances { y: 1.169056 } } +embedded_instances { + id: "cloud2" + data: "components {\n" + " id: \"cloudleft\"\n" + " component: \"/main/cloudleft.script\"\n" + "}\n" + "embedded_components {\n" + " id: \"cloud2\"\n" + " type: \"sprite\"\n" + " data: \"default_animation: \\\"cloudleft\\\"\\n" + "material: \\\"/builtins/materials/sprite.material\\\"\\n" + "size {\\n" + " x: 467.0\\n" + " y: 193.0\\n" + "}\\n" + "textures {\\n" + " sampler: \\\"texture_sampler\\\"\\n" + " texture: \\\"/main/graphics.atlas\\\"\\n" + "}\\n" + "\"\n" + "}\n" + "" + scale3 { + x: 1.226128 + y: 1.169056 + } +} diff --git a/main/startscreen.gui b/main/startscreen.gui index ee95f94..b111445 100644 --- a/main/startscreen.gui +++ b/main/startscreen.gui @@ -6,7 +6,7 @@ textures { nodes { position { x: 528.0 - y: 33.0 + y: 30.0 } scale { x: 1.625657 @@ -29,8 +29,8 @@ nodes { } nodes { position { - x: 530.0 - y: 239.0 + x: 527.0 + y: 236.0 } scale { x: 1.96425 @@ -52,8 +52,8 @@ nodes { } nodes { position { - x: 530.0 - y: 239.0 + x: 527.0 + y: 236.0 } scale { x: 0.9915 @@ -67,7 +67,7 @@ nodes { } nodes { position { - x: 528.0 + x: 527.0 y: 135.0 } scale { @@ -90,7 +90,7 @@ nodes { } nodes { position { - x: 528.0 + x: 527.0 y: 135.0 } scale { @@ -106,7 +106,7 @@ nodes { nodes { position { x: 528.0 - y: 33.0 + y: 30.0 } scale { x: 0.9915