Final stuff

This commit is contained in:
Heather 2025-09-14 15:20:29 +01:00
parent e5b01a95c0
commit a980557e27
12 changed files with 140 additions and 18 deletions

BIN
graphics/Gameover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
graphics/cloudleft.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
graphics/cloudright.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
graphics/startscreennew.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
graphics/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

56
main/cloudleft.script Normal file
View 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

View file

@ -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

View file

@ -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

View file

@ -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 {

View file

@ -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 {

View file

@ -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
}
}

View file

@ -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