Final stuff
This commit is contained in:
parent
e5b01a95c0
commit
a980557e27
12 changed files with 140 additions and 18 deletions
BIN
graphics/Gameover.png
Normal file
BIN
graphics/Gameover.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3 KiB |
BIN
graphics/cloudleft.png
Normal file
BIN
graphics/cloudleft.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
BIN
graphics/cloudright.png
Normal file
BIN
graphics/cloudright.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
BIN
graphics/startscreennew.png
Normal file
BIN
graphics/startscreennew.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
graphics/title.png
Normal file
BIN
graphics/title.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
56
main/cloudleft.script
Normal file
56
main/cloudleft.script
Normal file
|
|
@ -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
|
||||||
|
|
@ -2,8 +2,8 @@ local cloud_speed = 50 -- pixels per second
|
||||||
|
|
||||||
function init(self)
|
function init(self)
|
||||||
msg.post(".", "acquire_input_focus")
|
msg.post(".", "acquire_input_focus")
|
||||||
go.set_position(vmath.vector3(1055+390,542,0))
|
go.set_position(vmath.vector3(1055,542,0))
|
||||||
sprite.set_constant("#cloud1", "tint", vmath.vector4(1, 1, 1, 0.7))
|
-- sprite.set_constant("#cloud1", "tint", vmath.vector4(1, 1, 1, 0.9))
|
||||||
end
|
end
|
||||||
|
|
||||||
function final(self)
|
function final(self)
|
||||||
|
|
@ -16,8 +16,8 @@ function update(self, dt)
|
||||||
local pos = go.get_position("cloud1")
|
local pos = go.get_position("cloud1")
|
||||||
pos.x = pos.x - cloud_speed * dt
|
pos.x = pos.x - cloud_speed * dt
|
||||||
|
|
||||||
if pos.x < -390 then -- assuming cloud width is ~64px
|
if pos.x < -467 then -- assuming cloud width is ~64px
|
||||||
pos.x = 1055+390;
|
pos.x = 1055+467;
|
||||||
end
|
end
|
||||||
go.set_position(pos)
|
go.set_position(pos)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ function on_message(self, message_id, message, sender)
|
||||||
if message.group == hash("curse_jump_pads") then
|
if message.group == hash("curse_jump_pads") then
|
||||||
print("Oh yeah!")
|
print("Oh yeah!")
|
||||||
self.velocity.y = 150
|
self.velocity.y = 150
|
||||||
self.speed = 550
|
self.speed = 590
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if message_id == hash("visible") then
|
if message_id == hash("visible") then
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,17 @@ embedded_instances {
|
||||||
"embedded_components {\n"
|
"embedded_components {\n"
|
||||||
" id: \"sprite\"\n"
|
" id: \"sprite\"\n"
|
||||||
" type: \"sprite\"\n"
|
" type: \"sprite\"\n"
|
||||||
" data: \"default_animation: \\\"GameOverScreen\\\"\\n"
|
" data: \"default_animation: \\\"Gameover\\\"\\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"
|
||||||
|
" scale {\n"
|
||||||
|
" x: 1.0624\n"
|
||||||
|
" y: 1.0576\n"
|
||||||
|
" }\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
""
|
""
|
||||||
scale3 {
|
scale3 {
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,21 @@ images {
|
||||||
images {
|
images {
|
||||||
image: "/graphics/cloud.png"
|
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 {
|
animations {
|
||||||
id: "run_left"
|
id: "run_left"
|
||||||
images {
|
images {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ embedded_instances {
|
||||||
data: "embedded_components {\n"
|
data: "embedded_components {\n"
|
||||||
" id: \"sprite\"\n"
|
" id: \"sprite\"\n"
|
||||||
" type: \"sprite\"\n"
|
" type: \"sprite\"\n"
|
||||||
" data: \"default_animation: \\\"startscreen\\\"\\n"
|
" data: \"default_animation: \\\"startscreennew\\\"\\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"
|
||||||
|
|
@ -17,8 +17,28 @@ embedded_instances {
|
||||||
" y: 344.0\n"
|
" y: 344.0\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" scale {\n"
|
" scale {\n"
|
||||||
" x: 0.9915\n"
|
" x: 1.0956\n"
|
||||||
" y: 0.99\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"
|
||||||
"}\n"
|
"}\n"
|
||||||
""
|
""
|
||||||
|
|
@ -40,7 +60,7 @@ embedded_instances {
|
||||||
"embedded_components {\n"
|
"embedded_components {\n"
|
||||||
" id: \"cloud1\"\n"
|
" id: \"cloud1\"\n"
|
||||||
" type: \"sprite\"\n"
|
" type: \"sprite\"\n"
|
||||||
" data: \"default_animation: \\\"cloud\\\"\\n"
|
" data: \"default_animation: \\\"cloudright\\\"\\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"
|
||||||
|
|
@ -54,3 +74,30 @@ embedded_instances {
|
||||||
y: 1.169056
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ textures {
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
x: 528.0
|
x: 528.0
|
||||||
y: 33.0
|
y: 30.0
|
||||||
}
|
}
|
||||||
scale {
|
scale {
|
||||||
x: 1.625657
|
x: 1.625657
|
||||||
|
|
@ -29,8 +29,8 @@ nodes {
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
x: 530.0
|
x: 527.0
|
||||||
y: 239.0
|
y: 236.0
|
||||||
}
|
}
|
||||||
scale {
|
scale {
|
||||||
x: 1.96425
|
x: 1.96425
|
||||||
|
|
@ -52,8 +52,8 @@ nodes {
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
x: 530.0
|
x: 527.0
|
||||||
y: 239.0
|
y: 236.0
|
||||||
}
|
}
|
||||||
scale {
|
scale {
|
||||||
x: 0.9915
|
x: 0.9915
|
||||||
|
|
@ -67,7 +67,7 @@ nodes {
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
x: 528.0
|
x: 527.0
|
||||||
y: 135.0
|
y: 135.0
|
||||||
}
|
}
|
||||||
scale {
|
scale {
|
||||||
|
|
@ -90,7 +90,7 @@ nodes {
|
||||||
}
|
}
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
x: 528.0
|
x: 527.0
|
||||||
y: 135.0
|
y: 135.0
|
||||||
}
|
}
|
||||||
scale {
|
scale {
|
||||||
|
|
@ -106,7 +106,7 @@ nodes {
|
||||||
nodes {
|
nodes {
|
||||||
position {
|
position {
|
||||||
x: 528.0
|
x: 528.0
|
||||||
y: 33.0
|
y: 30.0
|
||||||
}
|
}
|
||||||
scale {
|
scale {
|
||||||
x: 0.9915
|
x: 0.9915
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue