diff --git a/TODO b/TODO index bda0b2f..a5785bb 100644 --- a/TODO +++ b/TODO @@ -1,13 +1,10 @@ +FAILED lol -write ruby script to output json table for processed art -FAILED -write ruby script to output json table for processed art - -DOnE -fix collision -flesh out full mythos, i.e.: where is the player, why is the player here, what is the player trying to get, who is here, what do they thin_ of the player's presence (are they happy? is the player an old face to them?) -decide on dialog trees YES -should puzzles be sort of secondary to exploration? li_e should most of the game be weird fun and interaction, and then the 'off the rails' parts should be puzzles??? - all of the npcs should be stuc_ in a cycle of whatever they're doing, focused on it, hav always been focused on it, maybe it has to do w/ the fact that they are always doing 'night activities' ma_e sprites static class vars instead of globals (?) @@ -18,4 +15,62 @@ so instead of having the exits be a part of the room save, they should be a sepa } why?? b/c this allows us to visually arrange levels and not have to open every adjacent file (as much as 4!!) and edit them -go for the feeling of the beginning of eternal sunshine w/ joel's narration, maybe a sense of desperation (does this require urgency?? should the game be time-limited li_e majora's mas_? lol) \ No newline at end of file +go for the feeling of the beginning of eternal sunshine w/ joel's narration, maybe a sense of desperation (does this require urgency?? should the game be time-limited li_e majora's mas_? lol) + +LEVEL EDITOR + +VIEWS: + - ROOM VIEW + - color select, red green or blue + - right pane should be sorted by folder i.e. "museum", "nature", "food" + - all pix that don't have an accompanying table entry describing what they are they should go under + "unsorted" + - ASSET EDIT VIEW + - here we can edit attributes such as class and collision and folder + - WORLD VIEW + - this is where we can arrange rooms + - right pane should have room palette, should be divided into a grid + - should be able to right-clic_ edit room?? + +SOOOOO +we are going to reimplement walls and boxes as generic moveable n unmoveable objects +we are going to have a Master Asset File which will be set up like this: + { + entityName = { + propsFile = "path/fo/propsfile.prop" + } + } + + or maybe we should just have one Big Prop File in the art directory, assets.prop, which would look like + + { + entityName = { + class = "class name" --moveable, unmoveable, npc, switch, player + sprite = { + red = "path/to/sprite.png" + } + loadSpriteOnBoot = (boolean) + } + } + + this should do fine tbh + +so then when we boot up the game it should load this table +room save should have entity name only + + + + + + + + + + + + +PUZZLE IDEAS + +so dialogue puzzles will be cool and neat +one of them can be two v similar loo_ing npcs completing one another +so one would have, in red "i o e o " and the other would have " l v y u" or w/e \ No newline at end of file diff --git a/art/ase_orig/cloud.ase b/art/_ase_orig/cloud.ase similarity index 100% rename from art/ase_orig/cloud.ase rename to art/_ase_orig/cloud.ase diff --git a/art/ase_orig/crying_moai_r.ase b/art/_ase_orig/crying_moai_r.ase similarity index 100% rename from art/ase_orig/crying_moai_r.ase rename to art/_ase_orig/crying_moai_r.ase diff --git a/art/ase_orig/drool.ase b/art/_ase_orig/drool.ase similarity index 100% rename from art/ase_orig/drool.ase rename to art/_ase_orig/drool.ase diff --git a/art/ase_orig/eye.ase b/art/_ase_orig/eye.ase similarity index 100% rename from art/ase_orig/eye.ase rename to art/_ase_orig/eye.ase diff --git a/art/ase_orig/heart.ase b/art/_ase_orig/heart.ase similarity index 100% rename from art/ase_orig/heart.ase rename to art/_ase_orig/heart.ase diff --git a/art/ase_orig/image2_b.ase b/art/_ase_orig/image2_b.ase similarity index 100% rename from art/ase_orig/image2_b.ase rename to art/_ase_orig/image2_b.ase diff --git a/art/ase_orig/image_r.ase b/art/_ase_orig/image_r.ase similarity index 100% rename from art/ase_orig/image_r.ase rename to art/_ase_orig/image_r.ase diff --git a/art/ase_orig/kiiro.ase b/art/_ase_orig/kiiro.ase similarity index 100% rename from art/ase_orig/kiiro.ase rename to art/_ase_orig/kiiro.ase diff --git a/art/ase_orig/palette.png b/art/_ase_orig/palette.png similarity index 100% rename from art/ase_orig/palette.png rename to art/_ase_orig/palette.png diff --git a/art/ase_orig/slime_woman.ase b/art/_ase_orig/slime_woman.ase similarity index 100% rename from art/ase_orig/slime_woman.ase rename to art/_ase_orig/slime_woman.ase diff --git a/art/ase_orig/wall.ase b/art/_ase_orig/wall.ase similarity index 100% rename from art/ase_orig/wall.ase rename to art/_ase_orig/wall.ase diff --git a/art/ase_orig/warai.ase b/art/_ase_orig/warai.ase similarity index 100% rename from art/ase_orig/warai.ase rename to art/_ase_orig/warai.ase diff --git a/art/font/slime_a.png b/art/_font/slime_a.png similarity index 100% rename from art/font/slime_a.png rename to art/_font/slime_a.png diff --git a/art/font/slime_c.png b/art/_font/slime_c.png similarity index 100% rename from art/font/slime_c.png rename to art/_font/slime_c.png diff --git a/art/font/slime_e.png b/art/_font/slime_e.png similarity index 100% rename from art/font/slime_e.png rename to art/_font/slime_e.png diff --git a/art/font/slime_h.png b/art/_font/slime_h.png similarity index 100% rename from art/font/slime_h.png rename to art/_font/slime_h.png diff --git a/art/font/slime_i.png b/art/_font/slime_i.png similarity index 100% rename from art/font/slime_i.png rename to art/_font/slime_i.png diff --git a/art/font/slime_l.png b/art/_font/slime_l.png similarity index 100% rename from art/font/slime_l.png rename to art/_font/slime_l.png diff --git a/art/font/slime_m.png b/art/_font/slime_m.png similarity index 100% rename from art/font/slime_m.png rename to art/_font/slime_m.png diff --git a/art/font/slime_o.png b/art/_font/slime_o.png similarity index 100% rename from art/font/slime_o.png rename to art/_font/slime_o.png diff --git a/art/font/slime_r.png b/art/_font/slime_r.png similarity index 100% rename from art/font/slime_r.png rename to art/_font/slime_r.png diff --git a/art/font/slime_s.png b/art/_font/slime_s.png similarity index 100% rename from art/font/slime_s.png rename to art/_font/slime_s.png diff --git a/art/font/slime_t.png b/art/_font/slime_t.png similarity index 100% rename from art/font/slime_t.png rename to art/_font/slime_t.png diff --git a/art/process/cone.png b/art/_process/cone.png similarity index 100% rename from art/process/cone.png rename to art/_process/cone.png diff --git a/art/process/kanashi.png b/art/_process/kanashi.png similarity index 100% rename from art/process/kanashi.png rename to art/_process/kanashi.png diff --git a/art/process/kinoko.png b/art/_process/kinoko.png similarity index 100% rename from art/process/kinoko.png rename to art/_process/kinoko.png diff --git a/art/process/lisa.png b/art/_process/lisa.png similarity index 100% rename from art/process/lisa.png rename to art/_process/lisa.png diff --git a/art/test_object.png b/art/_ui/bac.png similarity index 74% rename from art/test_object.png rename to art/_ui/bac.png index 1eacb38..7fb8062 100644 Binary files a/art/test_object.png and b/art/_ui/bac.png differ diff --git a/art/_ui/blue.png b/art/_ui/blue.png new file mode 100644 index 0000000..5740e7a Binary files /dev/null and b/art/_ui/blue.png differ diff --git a/art/_ui/cancel.png b/art/_ui/cancel.png new file mode 100644 index 0000000..4f4ae7d Binary files /dev/null and b/art/_ui/cancel.png differ diff --git a/art/_ui/confirm.png b/art/_ui/confirm.png new file mode 100644 index 0000000..13febe6 Binary files /dev/null and b/art/_ui/confirm.png differ diff --git a/art/_ui/folder.png b/art/_ui/folder.png new file mode 100644 index 0000000..6debf50 Binary files /dev/null and b/art/_ui/folder.png differ diff --git a/art/_ui/forward.png b/art/_ui/forward.png new file mode 100644 index 0000000..5ba5a73 Binary files /dev/null and b/art/_ui/forward.png differ diff --git a/art/_ui/green.png b/art/_ui/green.png new file mode 100644 index 0000000..11f70ed Binary files /dev/null and b/art/_ui/green.png differ diff --git a/art/_ui/red.png b/art/_ui/red.png new file mode 100644 index 0000000..dfeb0e2 Binary files /dev/null and b/art/_ui/red.png differ diff --git a/art/_ui/save.png b/art/_ui/save.png new file mode 100644 index 0000000..208a571 Binary files /dev/null and b/art/_ui/save.png differ diff --git a/art/_ui/white.png b/art/_ui/white.png new file mode 100644 index 0000000..0f4aa76 Binary files /dev/null and b/art/_ui/white.png differ diff --git a/art/_ui/world.png b/art/_ui/world.png new file mode 100644 index 0000000..ec6b301 Binary files /dev/null and b/art/_ui/world.png differ diff --git a/art/door_locked.png b/art/door_locked.png deleted file mode 100644 index 39182a8..0000000 Binary files a/art/door_locked.png and /dev/null differ diff --git a/art/door_locked_W.png b/art/door_locked_W.png deleted file mode 100644 index 90b0f58..0000000 Binary files a/art/door_locked_W.png and /dev/null differ diff --git a/art/switch_b.png b/art/game/ahhh/switch_b.png similarity index 100% rename from art/switch_b.png rename to art/game/ahhh/switch_b.png diff --git a/art/switch_g.png b/art/game/ahhh/switch_g.png similarity index 100% rename from art/switch_g.png rename to art/game/ahhh/switch_g.png diff --git a/art/switch_r.png b/art/game/ahhh/switch_r.png similarity index 100% rename from art/switch_r.png rename to art/game/ahhh/switch_r.png diff --git a/art/color_changing_floor_tile.png b/art/game/color_changing_floor_tile.png similarity index 100% rename from art/color_changing_floor_tile.png rename to art/game/color_changing_floor_tile.png diff --git a/art/color_changing_floor_tile_b.png b/art/game/color_changing_floor_tile_b.png similarity index 100% rename from art/color_changing_floor_tile_b.png rename to art/game/color_changing_floor_tile_b.png diff --git a/art/color_changing_floor_tile_g.png b/art/game/color_changing_floor_tile_g.png similarity index 100% rename from art/color_changing_floor_tile_g.png rename to art/game/color_changing_floor_tile_g.png diff --git a/art/color_changing_floor_tile_r.png b/art/game/color_changing_floor_tile_r.png similarity index 100% rename from art/color_changing_floor_tile_r.png rename to art/game/color_changing_floor_tile_r.png diff --git a/art/color_changing_wall.png b/art/game/color_changing_wall.png similarity index 100% rename from art/color_changing_wall.png rename to art/game/color_changing_wall.png diff --git a/art/door_locked_b.png b/art/game/door_locked_b.png similarity index 100% rename from art/door_locked_b.png rename to art/game/door_locked_b.png diff --git a/art/door_locked_g.png b/art/game/door_locked_g.png similarity index 100% rename from art/door_locked_g.png rename to art/game/door_locked_g.png diff --git a/art/door_locked_r.png b/art/game/door_locked_r.png similarity index 100% rename from art/door_locked_r.png rename to art/game/door_locked_r.png diff --git a/art/door_locked_w.png b/art/game/door_locked_w.png similarity index 100% rename from art/door_locked_w.png rename to art/game/door_locked_w.png diff --git a/art/door_unlocked.png b/art/game/door_unlocked.png similarity index 100% rename from art/door_unlocked.png rename to art/game/door_unlocked.png diff --git a/art/palette b/art/game/palette.png similarity index 100% rename from art/palette rename to art/game/palette.png diff --git a/art/player.png b/art/game/player.png similarity index 100% rename from art/player.png rename to art/game/player.png diff --git a/art/player_b.png b/art/game/player_b.png similarity index 100% rename from art/player_b.png rename to art/game/player_b.png diff --git a/art/player_g.png b/art/game/player_g.png similarity index 100% rename from art/player_g.png rename to art/game/player_g.png diff --git a/art/player_r.png b/art/game/player_r.png similarity index 100% rename from art/player_r.png rename to art/game/player_r.png diff --git a/art/player_sad.png b/art/game/player_sad.png similarity index 100% rename from art/player_sad.png rename to art/game/player_sad.png diff --git a/art/player_w.png b/art/game/player_w.png similarity index 100% rename from art/player_w.png rename to art/game/player_w.png diff --git a/art/static_wall.png b/art/game/static_wall.png similarity index 100% rename from art/static_wall.png rename to art/game/static_wall.png diff --git a/art/game/switch_b.png b/art/game/switch_b.png new file mode 100644 index 0000000..c55facb Binary files /dev/null and b/art/game/switch_b.png differ diff --git a/art/game/switch_g.png b/art/game/switch_g.png new file mode 100644 index 0000000..3fe21ef Binary files /dev/null and b/art/game/switch_g.png differ diff --git a/art/switch_pressed.png b/art/game/switch_pressed.png similarity index 100% rename from art/switch_pressed.png rename to art/game/switch_pressed.png diff --git a/art/game/switch_r.png b/art/game/switch_r.png new file mode 100644 index 0000000..82f6469 Binary files /dev/null and b/art/game/switch_r.png differ diff --git a/art/game/switch_reduced.png b/art/game/switch_reduced.png new file mode 100644 index 0000000..285f8bd Binary files /dev/null and b/art/game/switch_reduced.png differ diff --git a/art/wall_b.png b/art/game/wall_b.png similarity index 100% rename from art/wall_b.png rename to art/game/wall_b.png diff --git a/art/wall_g.png b/art/game/wall_g.png similarity index 100% rename from art/wall_g.png rename to art/game/wall_g.png diff --git a/art/wall_r.png b/art/game/wall_r.png similarity index 100% rename from art/wall_r.png rename to art/game/wall_r.png diff --git a/art/game2/processed/switch_reduced.png b/art/game2/processed/switch_reduced.png new file mode 100644 index 0000000..96119aa Binary files /dev/null and b/art/game2/processed/switch_reduced.png differ diff --git a/art/game2/switch.png b/art/game2/switch.png new file mode 100644 index 0000000..5868207 Binary files /dev/null and b/art/game2/switch.png differ diff --git a/art/house/books_stack.png b/art/house/books_stack.png deleted file mode 100644 index d6496b2..0000000 Binary files a/art/house/books_stack.png and /dev/null differ diff --git a/art/house/processed/books_stack_b.png b/art/house/books_stack_b.png similarity index 100% rename from art/house/processed/books_stack_b.png rename to art/house/books_stack_b.png diff --git a/art/house/processed/books_stack_g.png b/art/house/books_stack_g.png similarity index 100% rename from art/house/processed/books_stack_g.png rename to art/house/books_stack_g.png diff --git a/art/house/processed/books_stack_r.png b/art/house/books_stack_r.png similarity index 100% rename from art/house/processed/books_stack_r.png rename to art/house/books_stack_r.png diff --git a/art/house/bookshelf.png b/art/house/bookshelf.png deleted file mode 100644 index ef26d44..0000000 Binary files a/art/house/bookshelf.png and /dev/null differ diff --git a/art/house/processed/bookshelf_b.png b/art/house/bookshelf_b.png similarity index 100% rename from art/house/processed/bookshelf_b.png rename to art/house/bookshelf_b.png diff --git a/art/house/processed/bookshelf_g.png b/art/house/bookshelf_g.png similarity index 100% rename from art/house/processed/bookshelf_g.png rename to art/house/bookshelf_g.png diff --git a/art/house/processed/bookshelf_r.png b/art/house/bookshelf_r.png similarity index 100% rename from art/house/processed/bookshelf_r.png rename to art/house/bookshelf_r.png diff --git a/art/house/processed/books_stack_reduced.png b/art/house/preview/books_stack_reduced.png similarity index 100% rename from art/house/processed/books_stack_reduced.png rename to art/house/preview/books_stack_reduced.png diff --git a/art/house/processed/bookshelf_reduced.png b/art/house/preview/bookshelf_reduced.png similarity index 100% rename from art/house/processed/bookshelf_reduced.png rename to art/house/preview/bookshelf_reduced.png diff --git a/art/house/processed/table_reduced.png b/art/house/preview/table_reduced.png similarity index 100% rename from art/house/processed/table_reduced.png rename to art/house/preview/table_reduced.png diff --git a/art/house/processed/toilet_reduced.png b/art/house/preview/toilet_reduced.png similarity index 100% rename from art/house/processed/toilet_reduced.png rename to art/house/preview/toilet_reduced.png diff --git a/art/house/table.png b/art/house/table.png deleted file mode 100644 index 80bee33..0000000 Binary files a/art/house/table.png and /dev/null differ diff --git a/art/house/processed/table_b.png b/art/house/table_b.png similarity index 100% rename from art/house/processed/table_b.png rename to art/house/table_b.png diff --git a/art/house/processed/table_g.png b/art/house/table_g.png similarity index 100% rename from art/house/processed/table_g.png rename to art/house/table_g.png diff --git a/art/house/processed/table_r.png b/art/house/table_r.png similarity index 100% rename from art/house/processed/table_r.png rename to art/house/table_r.png diff --git a/art/house/toilet.png b/art/house/toilet.png deleted file mode 100644 index 37ee470..0000000 Binary files a/art/house/toilet.png and /dev/null differ diff --git a/art/house/processed/toilet_b.png b/art/house/toilet_b.png similarity index 100% rename from art/house/processed/toilet_b.png rename to art/house/toilet_b.png diff --git a/art/house/processed/toilet_g.png b/art/house/toilet_g.png similarity index 100% rename from art/house/processed/toilet_g.png rename to art/house/toilet_g.png diff --git a/art/house/processed/toilet_r.png b/art/house/toilet_r.png similarity index 100% rename from art/house/processed/toilet_r.png rename to art/house/toilet_r.png diff --git a/art/reduce_and_extract.sh b/art/reduce_and_extract.sh index c497155..1cced83 100755 --- a/art/reduce_and_extract.sh +++ b/art/reduce_and_extract.sh @@ -6,7 +6,7 @@ do echo "mapping $f to palette..." - convert $f +dither -map ../palette "processed/${NAME}_reduced.png" + convert $f +dither -map ../palette.png "processed/${NAME}_reduced.png" TARGET="processed/${NAME}_reduced.png" diff --git a/art/tech/processed/cd_b.png b/art/tech/cd_b.png similarity index 100% rename from art/tech/processed/cd_b.png rename to art/tech/cd_b.png diff --git a/art/tech/processed/cd_g.png b/art/tech/cd_g.png similarity index 100% rename from art/tech/processed/cd_g.png rename to art/tech/cd_g.png diff --git a/art/tech/processed/cd_r.png b/art/tech/cd_r.png similarity index 100% rename from art/tech/processed/cd_r.png rename to art/tech/cd_r.png diff --git a/art/tech/processed/cd_reduced.png b/art/tech/cd_reduced.png similarity index 100% rename from art/tech/processed/cd_reduced.png rename to art/tech/cd_reduced.png diff --git a/art/tech/processed/image2_b.png b/art/tech/image2_b.png similarity index 100% rename from art/tech/processed/image2_b.png rename to art/tech/image2_b.png diff --git a/art/tech/processed/image2_g.png b/art/tech/image2_g.png similarity index 100% rename from art/tech/processed/image2_g.png rename to art/tech/image2_g.png diff --git a/art/tech/processed/image2_r.png b/art/tech/image2_r.png similarity index 100% rename from art/tech/processed/image2_r.png rename to art/tech/image2_r.png diff --git a/art/tech/processed/image_b.png b/art/tech/image_b.png similarity index 100% rename from art/tech/processed/image_b.png rename to art/tech/image_b.png diff --git a/art/tech/processed/image_g.png b/art/tech/image_g.png similarity index 100% rename from art/tech/processed/image_g.png rename to art/tech/image_g.png diff --git a/art/tech/processed/image_r.png b/art/tech/image_r.png similarity index 100% rename from art/tech/processed/image_r.png rename to art/tech/image_r.png diff --git a/art/tech/processed/ipod_b.png b/art/tech/ipod_b.png similarity index 100% rename from art/tech/processed/ipod_b.png rename to art/tech/ipod_b.png diff --git a/art/tech/processed/ipod_g.png b/art/tech/ipod_g.png similarity index 100% rename from art/tech/processed/ipod_g.png rename to art/tech/ipod_g.png diff --git a/art/tech/processed/ipod_r.png b/art/tech/ipod_r.png similarity index 100% rename from art/tech/processed/ipod_r.png rename to art/tech/ipod_r.png diff --git a/art/tech/processed/ipod_reduced.png b/art/tech/ipod_reduced.png similarity index 100% rename from art/tech/processed/ipod_reduced.png rename to art/tech/ipod_reduced.png diff --git a/art/tech/processed/mac_b.png b/art/tech/mac_b.png similarity index 100% rename from art/tech/processed/mac_b.png rename to art/tech/mac_b.png diff --git a/art/tech/processed/mac_g.png b/art/tech/mac_g.png similarity index 100% rename from art/tech/processed/mac_g.png rename to art/tech/mac_g.png diff --git a/art/tech/processed/mac_r.png b/art/tech/mac_r.png similarity index 100% rename from art/tech/processed/mac_r.png rename to art/tech/mac_r.png diff --git a/art/tech/processed/mac_reduced.png b/art/tech/mac_reduced.png similarity index 100% rename from art/tech/processed/mac_reduced.png rename to art/tech/mac_reduced.png diff --git a/art/tech/processed/mac_smaller_b.png b/art/tech/mac_smaller_b.png similarity index 100% rename from art/tech/processed/mac_smaller_b.png rename to art/tech/mac_smaller_b.png diff --git a/art/tech/processed/mac_smaller_g.png b/art/tech/mac_smaller_g.png similarity index 100% rename from art/tech/processed/mac_smaller_g.png rename to art/tech/mac_smaller_g.png diff --git a/art/tech/processed/mac_smaller_r.png b/art/tech/mac_smaller_r.png similarity index 100% rename from art/tech/processed/mac_smaller_r.png rename to art/tech/mac_smaller_r.png diff --git a/art/tech/processed/mac_smaller_reduced.png b/art/tech/mac_smaller_reduced.png similarity index 100% rename from art/tech/processed/mac_smaller_reduced.png rename to art/tech/mac_smaller_reduced.png diff --git a/art/tech/cd.png b/art/tech/orig_smal/cd.png similarity index 100% rename from art/tech/cd.png rename to art/tech/orig_smal/cd.png diff --git a/art/tech/ipod.png b/art/tech/orig_smal/ipod.png similarity index 100% rename from art/tech/ipod.png rename to art/tech/orig_smal/ipod.png diff --git a/art/tech/mac_smaller.png b/art/tech/orig_smal/mac_smaller.png similarity index 100% rename from art/tech/mac_smaller.png rename to art/tech/orig_smal/mac_smaller.png diff --git a/art/test.png b/art/test.png deleted file mode 100644 index a5b2fc1..0000000 Binary files a/art/test.png and /dev/null differ diff --git a/box.lua b/box.lua index 0356898..a782f68 100644 --- a/box.lua +++ b/box.lua @@ -6,8 +6,6 @@ function Box:initialize(x, y, color) Entity.initialize(self, { x = x, y = y, - sizeX = 1, - sizeY = 1, color = color, collision = "moveable", sprite = sprites.box[color] diff --git a/entity.lua b/entity.lua index 7db9ea5..2d8bc88 100644 --- a/entity.lua +++ b/entity.lua @@ -46,6 +46,8 @@ function Entity:getOccupiedCells(coords) adjustedCell.y = pos.y + cell.y - 1 + offset.y table.insert(cells, adjustedCell) end + + -- print("cels!!!!", cells[1].x, cells[1].y) return cells end @@ -89,6 +91,15 @@ function Entity:getGridSize() return {x = self.size.w, y = self.size.h} end +function Entity:occupiesCell(inCell) + for _, cell in pairs(self:getOccupiedCells()) do + if cell.x == inCell.x and cell.y == inCell.y then + return true + end + end + return false +end + function Entity:getname() return self.name end diff --git a/font/dog.jpg b/font/dog.jpg new file mode 100644 index 0000000..e37dc1f Binary files /dev/null and b/font/dog.jpg differ diff --git a/font/font_strip66.png b/font/font_strip66.png new file mode 100644 index 0000000..7b31e14 Binary files /dev/null and b/font/font_strip66.png differ diff --git a/generic_moveable.lua b/generic_moveable.lua new file mode 100644 index 0000000..8ef7668 --- /dev/null +++ b/generic_moveable.lua @@ -0,0 +1,21 @@ +require "entity" + +GenericMoveable = class("GenericMoveable", Entity) + +function GenericMoveable:initialize(x, y, color, sprite) + Entity.initialize(self, { + x = x, + y = y, + color = color, + collision = "moveable", + sprite = sprite + }) +end + +function GenericMoveable:update() + +end + +function GenericMoveable:tick() + +end \ No newline at end of file diff --git a/generic_unmoveable.lua b/generic_unmoveable.lua new file mode 100644 index 0000000..7ab390e --- /dev/null +++ b/generic_unmoveable.lua @@ -0,0 +1,21 @@ +require "entity" + +GenericUnmoveable = class("GenericUnmoveable", Entity) + +function GenericUnmoveable:initialize(x, y, color, sprite) + Entity.initialize(self, { + x = x, + y = y, + color = color, + collision = "unmoveable", + sprite = sprite + }) +end + +function GenericUnmoveable:update(dt) + +end + +function GenericUnmoveable:tick() + +end \ No newline at end of file diff --git a/level_editor/editor.lua b/level_editor/editor.lua new file mode 100644 index 0000000..457d4f1 --- /dev/null +++ b/level_editor/editor.lua @@ -0,0 +1,389 @@ +require "level_editor/object_attributes" +require "level_editor/gui" + +editorView = "room" --can be "off", "room", "world", "asset" +selectedColor = "red" + +local bacSprite = love.graphics.newImage("art/_ui/bac.png") +local forwardSprite = love.graphics.newImage("art/_ui/forward.png") +local folderSprite = love.graphics.newImage("art/_ui/folder.png") +local cancelSprite = love.graphics.newImage("art/_ui/cancel.png") +local confirmSprite = love.graphics.newImage("art/_ui/confirm.png") + +local selectedFolder = nil +local selectedAsset = nil +local selectedRoom = nil +local selectedRow = 1 +local gameAssets = getAllAssets() +local inputText = "" +local assetProperties = {} + +local activeField = nil --this is for whenwe are doing text input things + +local uiButtons = {} +local folderButtons = {} +local assetButtons = { {} } --table for rows so we can do stuff +local editingAssetButtons = {} + +local labels = {} + + +function _initLevelEditor() + assets = getAllAssets() + + --create folder buttons + local counter = 1 + for folder, object in pairs(gameAssets) do + local button = createUIElement{ + name = "folder", + text = folder, + x = 30, + y = (sideBarBox.h - 50) * (counter / 15), + sprite = folderSprite, + onClic = { + left = function(self) + print("my asse") + selectFolder(folder) + end, + right = function() + + end + }, + } + counter = counter + 1 + table.insert(folderButtons, button) + end + + _addUIButton(createUIElement{ + name = "save", + sprite = love.graphics.newImage("art/_ui/save.png"), + onClic = { + left = function() + if editorView == "room" then + print("saveing!!") + currentRoom:save() + end + end, + right = function() + + end + }, + x = sideBarBox.w / 4, + y = sideBarBox.h * (9 / 10) + }) + + _addUIButton(createUIElement{ + name = "world", + sprite = love.graphics.newImage("art/_ui/world.png"), + onClic = { + left = function() + print(editorView) + if editorView == "room" then + print("saveing!!") + currentRoom:save() + end + end, + right = function() + + end + }, + x = sideBarBox.w * (3 / 4), + y = sideBarBox.h * (9 / 10) + }) + + for _, color in ipairs({"white", "red", "green", "blue"}) do + _addUIButton(createUIElement{ + name = color, + sprite = love.graphics.newImage("art/_ui/" .. color .. ".png"), + onClic = { + left = function(self) + if editorView == "room" then + setSelectedColor(color) + end + end, + right = function() + + end + }, + x = sideBarBox.w * (_ / 5), + y = sideBarBox.h * (8 / 10) + }) + end + +end + +function setSelectedColor(color) + selectedColor = color +end + +function selectFolder(folder) + selectedFolder = folder + + local bacButton = _addUIButton(createUIElement{ + name = "bacToFolderView", + sprite = bacSprite, + x = sideBarBox.w / 2, + y = 37.5, + onClic = { + left = function(self) + print(self, self.x) + self = nil + folderView(self) + end, + right = function(self) return end + } + }, "bacToFolderView") + local row = 1 + local counter = 1 + local limit = 10 + + for asset, colorArray in pairs(gameAssets[selectedFolder]) do + if counter % limit == 0 then + counter = 1 + + local forwardButton = createUIElement{ + name = "forward", + sprite = forwardSprite, + x = sideBarBox.w / 2, + y = sideBarBox.h - 250, + onClic = { + left = function() + selectedRow = selectedRow + 1 + end, + right = function() + + end + } + } + table.insert(assetButtons[row], forwardbutton) + + row = row + 1 + table.insert(assetButtons, {}) + end + + local sprites = {} + + for color, location in pairs(colorArray) do + sprites[color] = love.graphics.newImage(location) + end + + local assetButton = createUIElement{ + sprites = sprites, + name = "asset", + text = asset, + x = 30, + y = (sideBarBox.h - 225) * (counter / limit) + 20, + onClic = { + left = function() + print(asset) + selectAsset(asset) + end, + right = function() + editAsset(asset) + end + } + } + table.insert(assetButtons[row], assetButton) + counter = counter + 1 + end +end + +function selectAsset(asset) + print("selecting", asset) + selectedAsset = asset + print(selectedAsset) +end + +function editAsset(asset) + assetProperties = { + class = "", + } + + inputText = "" + editorView = "asset" + selectedAsset = asset + + local filename = "art/" .. selectedFolder .. "/" .. selectedAsset .. ".prop" + if love.filesystem.exists(filename) then + assetProperties = TSerial.unpack(love.filesystem.read(filename)) + end + + local cancelButton = createUIElement{ + name = "cancel", + sprite = cancelSprite, + x = sideBarBox.w / 3, + y = sideBarBox.h - 75, + onClic = { + left = function(self) + assetsView() + end, + right = function(self) return end + } + } + + local confirmButton = createUIElement{ + name = "confirm", + sprite = confirmSprite, + x = sideBarBox.w * 2 / 3, + y = sideBarBox.h - 75, + onClic = { + left = function(self) + saveAsset() + end, + right = function(self) return end + } + } + + editingAssetButtons[cancelButton] = cancelButton + editingAssetButtons[confirmButton] = confirmButton + + + local assetSprites = {} + for color, path in pairs(gameAssets[selectedFolder][selectedAsset]) do + assetSprites[color] = love.graphics.newImage(path) + end + + local assetButton = createUIElement{ + name = asset, + sprites = assetSprites, + x = sideBarBox.w / 2 - 18, + y = 80, + } + + local classFieldLabel = { + draw = function() love.graphics.printf("CLASS", 0, 125, sideBarBox.w, "center") end + } + + labels[classFieldLabel] = classFieldLabel + + local classButton = createUIElement{ + name = "class", + text = assetProperties.class or "", + x = 25, + y = 150, + onClic = { + left = function() + activeField = "class" + end + } + } + + editingAssetButtons[assetButton] = assetButton + editingAssetButtons.class = classButton +end + +function saveAsset() + local save = TSerial.pack(assetProperties, nil, true) + diditdoit = love.filesystem.write("art/" .. selectedFolder .. "/" .. selectedAsset .. ".prop", save) + print("fdfdfdfd", diditdoit) + assetsView() +end + + +function _addUIButton(button, name) + local index = name or button + uiButtons[index] = button +end + +function folderView() + selectedRow = 1 + selectedFolder = nil + assetButtons = {{}} + uiButtons.bacToFolderView = nil + labels = {} +end + +function assetsView() + editingAssetButtons = {} + editorView = "room" + labels = {} +end + +function worldView() + +end + +function editorMouseHandler(x, y, button) + if x > width then + --we need to adjust for sidebar coords + x = x - width + + if editorView == "room" then + if not selectedFolder then + for _, uiElement in pairs(folderButtons) do + if uiElement:clicIsInBox(x, y) then + uiElement:onClic(button) + return + end + end + else + for _, uiElement in pairs(assetButtons[selectedRow]) do + if uiElement:clicIsInBox(x, y) then + uiElement:onClic(button) + return + end + end + end + + for _, uiElement in pairs(uiButtons) do + if uiElement:clicIsInBox(x, y) then + uiElement:onClic(button) + end + end + elseif editorView == "asset" then + for _, uiElement in pairs(editingAssetButtons) do + if uiElement:clicIsInBox(x, y) then + uiElement:onClic(button) + end + end + end + end +end + +function editorTextHandler(text) + if editorView == "asset" and activeField then + inputText = text + editingAssetButtons[activeField]:editText(text) + end +end + +function editorCompleteResponse() + if editorView == "asset" then + assetProperties[activeField] = inputText + end + print(assetProperties[activeField], "ass") + activeField = nil +end + +function sortAllAssets() + setAll() +end + +function createUIElement(t) + return GUI:new(t) +end + +function editorDraw() + if editorView == "room" then + for _, button in pairs(uiButtons) do + button:draw() + end + if not selectedFolder then + for _, folder in pairs(folderButtons) do + folder:draw() + end + else + for _, entity in ipairs(assetButtons[selectedRow]) do + entity:draw() + end + end + elseif editorView == "asset" then + for _, button in pairs(editingAssetButtons) do + button:draw() + end + end + + for _, label in pairs(labels) do + label:draw() + end +end diff --git a/level_editor/gui.lua b/level_editor/gui.lua new file mode 100644 index 0000000..12cf916 --- /dev/null +++ b/level_editor/gui.lua @@ -0,0 +1,129 @@ +GUI = class("level_editor/gui") + +GUI.static.pressSound = love.audio.newSource("sounds/ui/button.wav") + +GUI.static.defaultCallbac = function() print("this button has not been configured") end + +function GUI:initialize(t) + print("i exist", t.name, t.text) + self.offset = {x = 0, y = 0} + self.name = t.name + self.text = t.text + + if not t.onClic then + t.onClic = {} + end + if not t.onClic.right then + t.onClic.right = GUI.defaultCallbac + end + if not t.onClic.left then + t.onClic.left = GUI.defaultCallbac + end + + self.clic = t.onClic + + self.x, self.y = t.x, t.y + + if t.sprite then + print(self.name) + self.scale = drawScale * 2 / 3 + self.w = t.sprite:getWidth() * self.scale + self.h = t.sprite:getHeight() * self.scale + self.sprite = t.sprite + + self.offset = {x = self.w / 2, y = self.h / 2} + self.x, self.y = t.x - self.offset.x, t.y - self.offset.y + elseif t.sprites then + self.sprites = t.sprites + local w, h + for color, sprite in pairs(t.sprites) do + w = sprite:getWidth() + h = sprite:getHeight() + end + if w > h then + self.scale = (drawScale * (2 / 3)) / (w / 16) + elseif w < h then + self.scale = (drawScale * (2 / 3)) / (h / 16) + else + self.scale = (drawScale * (2 / 3)) / (w / 16) + end + self.w = sideBarBox.w - (self.x * 2) + self.h = h * self.scale + else + -- this is text + self.x, self.y = t.x, t.y + self.w, self.h = sideBarBox.w - self.x * 2, 50 + end + + if self.name == "folder" then + self.w = sideBarBox.w - self.x * 2 + end +end + +function GUI:clicIsInBox(x, y) + if x > self.x and x < self.x + self.w and y > self.y and y < self.y + self.h then + return true + end + return false +end + +function GUI:getBox() + return {x = self.x, y = self.y, w = self.w, h = self.h} +end + +function GUI:editText(text) + self.text = text +end + +function GUI:draw() + + love.graphics.setColor(gColor.white:set()) + love.graphics.setLineWidth(4) + + local box = self:getBox() + box.x = box.x + self:sha() + box.y = box.y + self:sha() + + if name == "forward" then + print(box.x, box.y) + end + + if selectedColor == self.name then + love.graphics.rectangle("line", box.x, box.y, box.w, box.h) + end + + if self.sprite then + love.graphics.draw(self.sprite, box.x, box.y, 0, self.scale, self.scale) + end + + if self.sprites then + for color, sprite in pairs(self.sprites) do + love.graphics.setColor(gColor[color]:set()) + love.graphics.draw(sprite, box.x, box.y, 0, self.scale, self.scale) + end + end + + if self.text then + love.graphics.setColor(gColor.white:set()) + if not self.sprites and not self.sprite then + love.graphics.rectangle("line", box.x, box.y, box.w, box.h) + end + love.graphics.print(self.text, box.x + 50, box.y + 15) + end + +end + +function GUI:onClic(button) + print(button) + print("hey!!! u cliced on me. my name is ", self.name, self.text) + GUI.pressSound:play() + if button == "l" then + self.clic:left() + elseif button == "r" then + self.clic:right() + end +end + +function GUI:sha() + return math.random(-worldSha, worldSha) * .5 +end \ No newline at end of file diff --git a/level_editor/object_attributes.lua b/level_editor/object_attributes.lua new file mode 100644 index 0000000..49f3af5 --- /dev/null +++ b/level_editor/object_attributes.lua @@ -0,0 +1,43 @@ +require "libs/TSerial" + +local targetFolder = "art" + +function get(folder) + +end + +function getAllAssets() + local objectnames = {} + local topFolder = "art" + local files = love.filesystem.getDirectoryItems(topFolder) + for _, folder in pairs(files) do + if string.sub(folder, 1, 1) ~= "_" then + -- we ignore directories which are prepended w/ an underscore + if not string.find(folder, "%.") then + objectnames[folder] = {} + love.filesystem.createDirectory("art/" .. folder) + -- this is a folder, probably + local newFiles = love.filesystem.getDirectoryItems(topFolder .. "/" .. folder) + for _, fileToAnalyze in pairs(newFiles) do + if fileToAnalyze:find("_r.png") or fileToAnalyze:find("_g.png") or fileToAnalyze:find("_b.png")then + local color + + if fileToAnalyze:find("_r.png") then color = "red" + elseif fileToAnalyze:find("_g.png") then color = "green" + elseif fileToAnalyze:find("_b.png") then color = "blue" end + + local name = fileToAnalyze:sub(1, fileToAnalyze:len() - 6) + if not objectnames[folder][name] then + objectnames[folder][name] = {} + end + objectnames[folder][name][color] = topFolder .. "/" .. folder .. "/" .. fileToAnalyze + end + end + end + end + end + + str = TSerial.pack(objectnames, nil, true) + love.filesystem.write("great.sav", str) + return objectnames +end \ No newline at end of file diff --git a/main.lua b/main.lua index 6436ca9..125f207 100644 --- a/main.lua +++ b/main.lua @@ -1,9 +1,9 @@ love.graphics.setDefaultFilter("linear", "nearest") +local utf8 = require("utf8") class = require "libs/middleclass" Timer = require "libs/hump/timer" sfxr = require "libs/sfxrlua/sfxr" -json = require "libs/json4lua/json/json" require "_debug_helpers" require "_helpers" require "input" @@ -11,37 +11,42 @@ require "color" require "room" require "shaders" require "sprite_manager" +require "level_editor/editor" function love.load() _initDefaults() _initGridVars() _initSounds() _initGlobalColors() + _initLevelEditor() processSprites() gameCanvas = love.graphics.newCanvas() + sideBarCanvas = love.graphics.newCanvas(sideBarBox.w, sideBarBox.h) finalCanvas = love.graphics.newCanvas() + inputTimer = Timer.new() currentRoom = Room:new{ - player = { - x = 5, y = 5, activeColors = {"red", "green", "blue"} - } + name = "test" } + + response = "" end function love.update(dt) Input:handler(dt) currentRoom:update(dt) - if love.keyboard.isDown("w") then worldSha = worldSha + 1 end - if love.keyboard.isDown("s") then worldSha = worldSha - 1 end + -- if love.keyboard.isDown("w") then worldSha = worldSha + 1 end + -- if love.keyboard.isDown("s") then worldSha = worldSha - 1 end end function love.draw() gameCanvas:clear() finalCanvas:clear() + sideBarCanvas:clear() love.graphics.setCanvas(gameCanvas) love.graphics.setBlendMode("screen") @@ -67,9 +72,14 @@ function love.draw() love.graphics.draw(gameCanvas, 0, 0) love.graphics.setCanvas() + love.graphics.setCanvas(sideBarCanvas) + editorDraw() + love.graphics.setCanvas() + love.graphics.setBlendMode("alpha") love.graphics.setColor(255, 255, 255, 255) love.graphics.draw(finalCanvas, 0, 0) + love.graphics.draw(sideBarCanvas, sideBarBox.x, sideBarBox.y) love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10) end @@ -81,12 +91,39 @@ function love.keypressed(key) local c = Input.playerColor(key) currentRoom:switchPlayerColor(c) end - if key == "w" then - worldSha = worldSha + 1 + + -- if key == "w" then + -- worldSha = worldSha + 1 + -- end + -- if key == "s" then + -- worldSha = worldSha - 1 + -- end + + if key == "return" then + response = "" + editorCompleteResponse() + elseif key == "backspace" then + local byteoffset = utf8.offset(response, -1) + + if byteoffset then + -- remove the last UTF-8 character. + -- string.sub operates on bytes rather than UTF-8 characters, so we couldn't do string.sub(response, 1, -2). + response = string.sub(response, 1, byteoffset - 1) + editorTextHandler(response) + end end - if key == "s" then - worldSha = worldSha - 1 +end + +function love.mousepressed(x, y, button) + if button == "r" then + currentRoom:attemptDelete(x, y) end + editorMouseHandler(x, y, button) +end + +function love.textinput(t) + response = response .. t + editorTextHandler(response) end function _initDefaults() @@ -105,6 +142,13 @@ function _initDefaults() --set randomseed math.randomseed(os.time()) + + --font + font = love.graphics.newFont("font/LCD_Solid.ttf", 16) + love.graphics.setFont(font) + + --sidebar + sideBarBox = {x = width, y = 0, w = love.graphics.getWidth() - width, h = height} end function _initGridVars() diff --git a/room.lua b/room.lua index a4b9d58..1faa9cd 100644 --- a/room.lua +++ b/room.lua @@ -11,6 +11,8 @@ require "assorted" require "switch" require "door" require "dialogue_manager" +require "generic_moveable" +require "generic_unmoveable" function Room:initialize(t) self.player = {} @@ -23,9 +25,17 @@ function Room:initialize(t) if t.name then print("loaded!!") self:load(t.name) - for _, color in ipairs(t.player.activeColors) do - self:registerPlayer(Player:new(t.player.x, t.player.y, color), color) - self:setActiveColor(color, true) + print(t.name) + if t.player then + for _, color in ipairs(t.player.activeColors) do + self:registerPlayer(Player:new(t.player.x, t.player.y, color), color) + self:setActiveColor(color, true) + end + else + for color, active in pairs(self.activeColors) do + self:registerPlayer(Player:new(1, 1, color), color) + self:setActiveColor(color, true) + end end self.exits = t.exits self.name = t.name @@ -45,36 +55,36 @@ function Room:initialize(t) -- self.activeColors[color] = true -- end - for i=1, 1 do - local x, y = randomPosition() - -- local door = Door:new(x, y, self.colorsPlayerHas) - -- table.insert(self.doors, door) - - for color, active in pairs(self.activeColors) do - table.insert(self.collideables[color], Wall:new(x, y, color)) - end - end - - for i=0, 5 do - local x, y = randomPosition() - for color, active in pairs(self.activeColors) do - table.insert(self.collideables[color], Box:new(x, y, color)) - end - end - - -- for i = 0, 5 do + -- for i=1, 1 do -- local x, y = randomPosition() - -- print(x, y) - -- local c = randomColor() - -- table.insert(self.switches[c], Switch:new(x, y, c)) + -- -- local door = Door:new(x, y, self.colorsPlayerHas) + -- -- table.insert(self.doors, door) + + -- for color, active in pairs(self.activeColors) do + -- table.insert(self.collideables[color], Wall:new(x, y, color)) + -- end -- end + -- for i=0, 5 do + -- local x, y = randomPosition() + -- for color, active in pairs(self.activeColors) do + -- table.insert(self.collideables[color], Box:new(x, y, color)) + -- end + -- end + + for i = 0, 5 do + local x, y = randomPosition() + print(x, y) + local c = randomColor() + table.insert(self.switches[c], Switch:new(x, y, c)) + end + for color, active in pairs(self.activeColors) do local x, y = 6, 3 -- if active then self.collideables[color]["n: " .. x .. ", " .. y] = Ass:new(x, y, color, "animals/processed/", "me_rach") end local x, y = 1, 1 - if active then table.insert(self.collideables[color], Ass:new(x, y, color, "nature/", "palm_scaled_reduced")) end + -- if active then table.insert(self.collideables[color], Ass:new(x, y, color, "nature/", "palm_scaled_reduced")) end -- local x, y = 7, 7 -- if active then self.collideables[color]["n: " .. x .. ", " .. y] = Ass:new(x, y, color, "food/processed/", "beer_mug") end @@ -539,6 +549,44 @@ function Room:registerPlayer(entityPointer, color) self.player[color] = entityPointer end +function Room:getCellFromMousePos(mouseX, mouseY) + local cell = {} + cell.x = math.ceil(mouseX * gridWidth / width) + cell.y = math.ceil(mouseY * gridHeight / height) + return cell +end + +function Room:attemptDelete(mouseX, mouseY) + local cell = self:getCellFromMousePos(mouseX, mouseY) + for color, player in pairs(self.player) do + if player:occupiesCell(cell) then + self.player[color] = nil + self.colorsPlayerHas[color] = false + end + end + local entities = {} + for color, entityArray in pairs(self.collideables) do + for index, entity in pairs(entityArray) do + if entity:occupiesCell(cell) then + table.remove(self.collideables[color], index) + end + end + end + for color, switches in pairs(self.switches) do + for index, switch in pairs(switches) do + if switch:occupiesCell(cell) then + print("assssss occupied scellsll") + table.remove(self.switches[color], index) + end + end + end + self:tick() +end + +function Room:attemptPlace() + +end + function Room:load(name) local room = love.filesystem.read("rooms/" .. name .. ".sav") self:deserialize(TSerial.unpack(room)) @@ -614,7 +662,7 @@ function nextRoom(pos) currentRoom:save() currentRoom = Room:new{ - name = "test", + -- name = "test", player = { x = newPos.x, y = newPos.y, activeColors = currentRoom:getActiveColors() } diff --git a/sounds/ui/button.wav b/sounds/ui/button.wav new file mode 100644 index 0000000..b707eaa Binary files /dev/null and b/sounds/ui/button.wav differ diff --git a/sprite_manager.lua b/sprite_manager.lua index d287598..1c78994 100644 --- a/sprite_manager.lua +++ b/sprite_manager.lua @@ -1,39 +1,37 @@ sprites = { - player = love.graphics.newImage("art/player.png"), - wall = love.graphics.newImage("art/static_wall.png"), + player = love.graphics.newImage("art/game/player.png"), + wall = love.graphics.newImage("art/game/static_wall.png"), box = { - red = love.graphics.newImage("art/wall_r.png"), - green = love.graphics.newImage("art/wall_g.png"), - blue = love.graphics.newImage("art/wall_b.png") + red = love.graphics.newImage("art/game/wall_r.png"), + green = love.graphics.newImage("art/game/wall_g.png"), + blue = love.graphics.newImage("art/game/wall_b.png") }, door = { - white = love.graphics.newImage("art/door_locked_w.png"), - red = love.graphics.newImage("art/door_locked_r.png"), - green = love.graphics.newImage("art/door_locked_g.png"), - blue = love.graphics.newImage("art/door_locked_b.png"), - unlocked = love.graphics.newImage("art/door_unlocked.png") + white = love.graphics.newImage("art/game/door_locked_w.png"), + red = love.graphics.newImage("art/game/door_locked_r.png"), + green = love.graphics.newImage("art/game/door_locked_g.png"), + blue = love.graphics.newImage("art/game/door_locked_b.png"), + unlocked = love.graphics.newImage("art/game/door_unlocked.png") }, switch = { - red = love.graphics.newImage("art/switch_r.png"), - green = love.graphics.newImage("art/switch_g.png"), - blue = love.graphics.newImage("art/switch_b.png") + red = love.graphics.newImage("art/game/switch_r.png"), + green = love.graphics.newImage("art/game/switch_g.png"), + blue = love.graphics.newImage("art/game/switch_b.png") }, water = { red = love.graphics.newImage("art/nature/water_r.png"), green = love.graphics.newImage("art/nature/water_g.png"), blue = love.graphics.newImage("art/nature/water_b.png") }, - mac_smaller = love.graphics.newImage("art/tech/processed/mac_smaller_r.png"), + mac_smaller = love.graphics.newImage("art/tech/mac_smaller_r.png"), tree = { red = love.graphics.newImage("art/nature/palm_scaled_r.png"), green = love.graphics.newImage("art/nature/palm_scaled_g.png"), blue = love.graphics.newImage("art/nature/palm_scaled_b.png") }, - test_object = love.graphics.newImage("art/test_object.png"), npcs = { }, - artifact = love.graphics.newImage("art/process/cone.png"), } spriteCells = {} @@ -43,7 +41,6 @@ function processSprites() getCellsFromSprite(sprites.player) for name, spriteObj in pairs(sprites) do - print(name) if type(spriteObj) == "table" then spriteCells[name] = {} --this is multicolored so... @@ -88,7 +85,6 @@ function getCellsFromSprite(sprite) end if empty then - print("empty @ ", cell.x, cell.y) cellsToRemove[cell] = cell --references boxCells cell so comparison should wor_ end end diff --git a/switch.lua b/switch.lua index 3788df5..8213258 100644 --- a/switch.lua +++ b/switch.lua @@ -3,10 +3,10 @@ require "entity" Switch = class("Switch", Entity) Switch.static.sprites = { - red = love.graphics.newImage("art/switch_r.png"), - green = love.graphics.newImage("art/switch_g.png"), - blue = love.graphics.newImage("art/switch_b.png"), - pressed = love.graphics.newImage("art/switch_pressed.png") + red = love.graphics.newImage("art/game/switch_r.png"), + green = love.graphics.newImage("art/game/switch_g.png"), + blue = love.graphics.newImage("art/game/switch_b.png"), + pressed = love.graphics.newImage("art/game/switch_pressed.png") } function Switch:initialize(x, y, color) @@ -15,6 +15,7 @@ function Switch:initialize(x, y, color) y = y, color = color, collision = "none", --switches are floor elements that can't be pushed or bloc movement!! + cellShape = {{x = 1, y = 1}}, sprite = sprites.switch[color] })