From 462d2401e1a21442c26182426fc03e75253be68f Mon Sep 17 00:00:00 2001 From: Victor Levasseur Date: Mon, 8 Feb 2016 20:58:23 +0100 Subject: [PATCH] Add new block and improve the example level --- game/resources/level.lua | 456 +++++++++++++++++- .../kenney/block_grass_slope_left.lua | 64 +++ .../kenney/block_grass_slope_left_center.lua | 68 +++ ...lope45.lua => block_grass_slope_right.lua} | 2 +- .../kenney/block_grass_slope_right_center.lua | 68 +++ 5 files changed, 637 insertions(+), 21 deletions(-) create mode 100644 game/resources/templates/kenney/block_grass_slope_left.lua create mode 100644 game/resources/templates/kenney/block_grass_slope_left_center.lua rename game/resources/templates/kenney/{slope45.lua => block_grass_slope_right.lua} (97%) create mode 100644 game/resources/templates/kenney/block_grass_slope_right_center.lua diff --git a/game/resources/level.lua b/game/resources/level.lua index 62386648..b4b1ca7f 100644 --- a/game/resources/level.lua +++ b/game/resources/level.lua @@ -12,80 +12,496 @@ level = { id = 1, template = "kenney_block_grass", values = { - x = 80, - y = 350, + x = 1*64, + y = 6*64, } }, { id = 2, template = "kenney_block_grass", values = { - x = 144, - y = 350, + x = 2*64, + y = 6*64, } }, { id = 3, template = "kenney_block_grass", values = { - x = 208, - y = 350, + x = 3*64, + y = 6*64, } }, { id = 4, template = "kenney_block_grass", values = { - x = 272, - y = 350, + x = 4*64, + y = 6*64, } }, { id = 5, template = "kenney_block_grass_center", values = { - x = 80, - y = 414, + x = 1*64, + y = 7*64, } }, { id = 6, template = "kenney_block_grass_center", values = { - x = 144, - y = 414, + x = 2*64, + y = 7*64, } }, { id = 7, template = "kenney_block_grass_center", values = { - x = 208, - y = 414, + x = 3*64, + y = 7*64, } }, { id = 8, template = "kenney_block_grass_center", values = { - x = 272, - y = 414, + x = 4*64, + y = 7*64, } }, { id = 9, template = "kenney_block_wood_platform", values = { - x = 144, - y = 230, + x = 2*64, + y = 4.5*64, } }, { id = 10, template = "kenney_block_wood_platform", values = { - x = 208, - y = 230, + x = 3*64, + y = 4.5*64, + } + }, + { + id = 11, + template = "kenney_block_grass_center", + values = { + x = 1*64, + y = 11*64, + } + }, + { + id = 12, + template = "kenney_block_grass_center", + values = { + x = 2*64, + y = 11*64, + } + }, + { + id = 13, + template = "kenney_block_grass_center", + values = { + x = 3*64, + y = 11*64, + } + }, + { + id = 14, + template = "kenney_block_grass_center", + values = { + x = 4*64, + y = 11*64, + } + }, + { + id = 15, + template = "kenney_block_grass_center", + values = { + x = 5*64, + y = 11*64, + } + }, + { + id = 16, + template = "kenney_block_grass_center", + values = { + x = 6*64, + y = 11*64, + } + }, + { + id = 17, + template = "kenney_block_grass_center", + values = { + x = 7*64, + y = 11*64, + } + }, + { + id = 18, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 11*64, + } + }, + { + id = 19, + template = "kenney_block_grass_center", + values = { + x = 9*64, + y = 11*64, + } + }, + { + id = 20, + template = "kenney_block_grass_center", + values = { + x = 10*64, + y = 11*64, + } + }, + { + id = 21, + template = "kenney_block_grass_center", + values = { + x = 11*64, + y = 11*64, + } + }, + { + id = 22, + template = "kenney_block_grass_center", + values = { + x = 12*64, + y = 11*64, + } + }, + { + id = 23, + template = "kenney_block_grass_center", + values = { + x = 1*64, + y = 10*64, + } + }, + { + id = 24, + template = "kenney_block_grass_center", + values = { + x = 1*64, + y = 9*64, + } + }, + { + id = 25, + template = "kenney_block_grass_center", + values = { + x = 1*64, + y = 8*64, + } + }, + { + id = 26, + template = "kenney_block_grass_center", + values = { + x = 13*64, + y = 11*64, + } + }, + { + id = 27, + template = "kenney_block_grass_center", + values = { + x = 14*64, + y = 11*64, + } + }, + { + id = 28, + template = "kenney_block_grass_center", + values = { + x = 14*64, + y = 10*64, + } + }, + { + id = 29, + template = "kenney_block_grass_center", + values = { + x = 14*64, + y = 9*64, + } + }, + { + id = 30, + template = "kenney_block_grass_center", + values = { + x = 14*64, + y = 8*64, + } + }, + { + id = 31, + template = "kenney_block_wood_platform", + values = { + x = 5*64, + y = 6*64, + } + }, + { + id = 31, + template = "kenney_block_wood_platform", + values = { + x = 7*64, + y = 6*64, + } + }, + { + id = 31, + template = "kenney_block_wood_platform", + values = { + x = 6*64, + y = 7*64, + } + }, + { + id = 32, + template = "kenney_block_wood_platform", + values = { + x = 5*64, + y = 10*64, + } + }, + { + id = 35, + template = "kenney_block_wood_platform", + values = { + x = 6*64, + y = 9*64, + } + }, + { + id = 36, + template = "kenney_block_wood_platform", + values = { + x = 7*64, + y = 9*64, + } + }, + { + id = 37, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 8*64, + } + }, + { + id = 38, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 7*64, + } + }, + { + id = 39, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 6*64, + } + }, + { + id = 40, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 5*64, + } + }, + { + id = 41, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 4*64, + } + }, + { + id = 42, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 3*64, + } + }, + { + id = 43, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 2*64, + } + }, + { + id = 44, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 1*64, + } + }, + { + id = 45, + template = "kenney_block_grass_center", + values = { + x = 8*64, + y = 0*64, + } + }, + { + id = 46, + template = "kenney_block_grass_center", + values = { + x = 14*64, + y = 7*64, + } + }, + { + id = 47, + template = "kenney_block_grass", + values = { + x = 14*64, + y = 6*64, + } + }, + { + id = 48, + template = "kenney_block_grass", + values = { + x = 10*64, + y = 10*64, + } + }, + { + id = 49, + template = "kenney_block_grass_slope_right", + values = { + x = 11*64, + y = 9*64, + } + }, + { + id = 50, + template = "kenney_block_grass_slope_right", + values = { + x = 12*64, + y = 8*64, + } + }, + { + id = 51, + template = "kenney_block_grass_slope_right", + values = { + x = 13*64, + y = 7*64, + } + }, + { + id = 52, + template = "kenney_block_grass_slope_right_center", + values = { + x = 11*64, + y = 10*64, + } + }, + { + id = 53, + template = "kenney_block_grass_slope_right_center", + values = { + x = 12*64, + y = 9*64, + } + }, + { + id = 53, + template = "kenney_block_grass_slope_right_center", + values = { + x = 13*64, + y = 8*64, + } + }, + { + id = 54, + template = "kenney_block_grass_center", + values = { + x = 13*64, + y = 9*64, + } + }, + { + id = 55, + template = "kenney_block_grass_center", + values = { + x = 13*64, + y = 10*64, + } + }, + { + id = 56, + template = "kenney_block_grass_center", + values = { + x = 12*64, + y = 10*64, + } + }, + { + id = 57, + template = "kenney_block_grass_slope_right", + values = { + x = 9*64, + y = 10*64, + } + }, + { + id = 58, + template = "kenney_block_wood_platform", + values = { + x = 9*64, + y = 4.5*64, + } + }, + { + id = 59, + template = "kenney_block_wood_platform", + values = { + x = 10*64, + y = 4.5*64, + } + }, + { + id = 60, + template = "kenney_block_wood_platform", + values = { + x = 11*64, + y = 4.5*64, + } + }, + { + id = 61, + template = "kenney_block_wood_platform", + values = { + x = 12*64, + y = 4.5*64, } }, } diff --git a/game/resources/templates/kenney/block_grass_slope_left.lua b/game/resources/templates/kenney/block_grass_slope_left.lua new file mode 100644 index 00000000..01cca8b6 --- /dev/null +++ b/game/resources/templates/kenney/block_grass_slope_left.lua @@ -0,0 +1,64 @@ +entity_template = { + name = "kenney_block_grass_slope_left", + friendlyname = "Friendly name of template", + + parameters = { + x = { + name = "X position", + component = "Position", + type = "number", + attribute = "x", + }, + y = { + name = "Y position", + component = "Position", + type = "number", + attribute = "y", + }, + }, + + components = { + ["Position"] = { + x = 0, + y = 0, + width = 64, + height = 64 + }, + ["Platform"] = { + + }, + ["Hitbox"] = { + polygon = { + points = { + { + x = 0, + y = 0 + }, + { + x = 64, + y = 64 + }, + { + x = 0, + y = 64 + }, + } + } + }, + ["Render"] = { + texture = "spritesheet_complete.png", + current_animation = "default", + animations = { + ["default"] = { + total_duration = 1, + frames = { + { + rect = { left = 1560, top = 780, width = 128, height = 128}, + relative_duration = 1, + }, + }, + }, + }, + } + } +} diff --git a/game/resources/templates/kenney/block_grass_slope_left_center.lua b/game/resources/templates/kenney/block_grass_slope_left_center.lua new file mode 100644 index 00000000..2395be95 --- /dev/null +++ b/game/resources/templates/kenney/block_grass_slope_left_center.lua @@ -0,0 +1,68 @@ +entity_template = { + name = "kenney_block_grass_slope_right_center", + friendlyname = "Friendly name of template", + + parameters = { + x = { + name = "X position", + component = "Position", + type = "number", + attribute = "x", + }, + y = { + name = "Y position", + component = "Position", + type = "number", + attribute = "y", + }, + }, + + components = { + ["Position"] = { + x = 0, + y = 0, + width = 64, + height = 64 + }, + ["Platform"] = { + + }, + ["Hitbox"] = { + polygon = { + points = { + { + x = 0, + y = 0 + }, + { + x = 64, + y = 0 + }, + { + x = 64, + y = 64 + }, + { + x = 0, + y = 64 + }, + } + } + }, + ["Render"] = { + texture = "spritesheet_complete.png", + current_animation = "default", + animations = { + ["default"] = { + total_duration = 1, + frames = { + { + rect = { left = 1560, top = 1430, width = 128, height = 128}, + relative_duration = 1, + }, + }, + }, + }, + } + } +} diff --git a/game/resources/templates/kenney/slope45.lua b/game/resources/templates/kenney/block_grass_slope_right.lua similarity index 97% rename from game/resources/templates/kenney/slope45.lua rename to game/resources/templates/kenney/block_grass_slope_right.lua index cb66c0d5..445f1120 100644 --- a/game/resources/templates/kenney/slope45.lua +++ b/game/resources/templates/kenney/block_grass_slope_right.lua @@ -1,5 +1,5 @@ entity_template = { - name = "kenney_slope45", + name = "kenney_block_grass_slope_right", friendlyname = "Friendly name of template", parameters = { diff --git a/game/resources/templates/kenney/block_grass_slope_right_center.lua b/game/resources/templates/kenney/block_grass_slope_right_center.lua new file mode 100644 index 00000000..aaec211a --- /dev/null +++ b/game/resources/templates/kenney/block_grass_slope_right_center.lua @@ -0,0 +1,68 @@ +entity_template = { + name = "kenney_block_grass_slope_right_center", + friendlyname = "Friendly name of template", + + parameters = { + x = { + name = "X position", + component = "Position", + type = "number", + attribute = "x", + }, + y = { + name = "Y position", + component = "Position", + type = "number", + attribute = "y", + }, + }, + + components = { + ["Position"] = { + x = 0, + y = 0, + width = 64, + height = 64 + }, + ["Platform"] = { + + }, + ["Hitbox"] = { + polygon = { + points = { + { + x = 0, + y = 0 + }, + { + x = 64, + y = 0 + }, + { + x = 64, + y = 64 + }, + { + x = 0, + y = 64 + }, + } + } + }, + ["Render"] = { + texture = "spritesheet_complete.png", + current_animation = "default", + animations = { + ["default"] = { + total_duration = 1, + frames = { + { + rect = { left = 1560, top = 1560, width = 128, height = 128}, + relative_duration = 1, + }, + }, + }, + }, + } + } +}