diff --git a/TODO b/TODO new file mode 100644 index 0000000..584f410 --- /dev/null +++ b/TODO @@ -0,0 +1,8 @@ +-write ruby script to output json table for processed art +-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 +-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' \ No newline at end of file diff --git a/_helpers.lua b/_helpers.lua new file mode 100644 index 0000000..ff1be04 --- /dev/null +++ b/_helpers.lua @@ -0,0 +1,18 @@ +function constrain(val, low, high) + if val > high then + return high + elseif val < low then + return low + else + return val + end +end + +function map(value, inMin, inMax, outMin, outMax) + local inPercent = value / (inMax - inMin) + return (outMax - outMin) * (inPercent) + outMin +end + +function lerp(a, b, amount) + return (1 - amount) * a + (amount * b) +end diff --git a/art.lua b/art.lua new file mode 100644 index 0000000..943e633 --- /dev/null +++ b/art.lua @@ -0,0 +1,23 @@ +require "entity" + +Art = class("Art", Entity) + +function Art:initialize(x, y, color, name) + local spr = love.graphics.newImage("art/museum/to_process/cropped/processed/" .. name .. "_" .. string.lower(string.sub(color, 1, 1)) ..".png") + Entity.initialize(self, { + x = x, + y = y, + color = color, + collision = "moveable", --player can't push other player + sprite = spr + }) +end + + +function Art:draw() + love.graphics.setColor(self.color:set()) + local p = self:getDrawBox() + love.graphics.setLineWidth(drawScale) --equivalent of one pixel + love.graphics.rectangle("line", p.x, p.y, p.w, p.h) + love.graphics.draw(self.sprite, p.x, p.y, 0, drawScale, drawScale) +end \ No newline at end of file diff --git a/art/animals/badger.png b/art/animals/badger.png new file mode 100644 index 0000000..f0a8801 Binary files /dev/null and b/art/animals/badger.png differ diff --git a/art/animals/orig/sad_frog.jpg b/art/animals/orig/sad_frog.jpg new file mode 100644 index 0000000..1e8719f Binary files /dev/null and b/art/animals/orig/sad_frog.jpg differ diff --git a/art/animals/processed/badger_b.png b/art/animals/processed/badger_b.png new file mode 100644 index 0000000..568a716 Binary files /dev/null and b/art/animals/processed/badger_b.png differ diff --git a/art/animals/processed/badger_g.png b/art/animals/processed/badger_g.png new file mode 100644 index 0000000..568a716 Binary files /dev/null and b/art/animals/processed/badger_g.png differ diff --git a/art/animals/processed/badger_r.png b/art/animals/processed/badger_r.png new file mode 100644 index 0000000..d71f438 Binary files /dev/null and b/art/animals/processed/badger_r.png differ diff --git a/art/animals/processed/badger_reduced.png b/art/animals/processed/badger_reduced.png new file mode 100644 index 0000000..36eab8d Binary files /dev/null and b/art/animals/processed/badger_reduced.png differ diff --git a/art/animals/processed/sad_frog_b.png b/art/animals/processed/sad_frog_b.png new file mode 100644 index 0000000..c1e4708 Binary files /dev/null and b/art/animals/processed/sad_frog_b.png differ diff --git a/art/animals/processed/sad_frog_g.png b/art/animals/processed/sad_frog_g.png new file mode 100644 index 0000000..970bb2b Binary files /dev/null and b/art/animals/processed/sad_frog_g.png differ diff --git a/art/animals/processed/sad_frog_r.png b/art/animals/processed/sad_frog_r.png new file mode 100644 index 0000000..a826d0c Binary files /dev/null and b/art/animals/processed/sad_frog_r.png differ diff --git a/art/animals/processed/sad_frog_reduced.png b/art/animals/processed/sad_frog_reduced.png new file mode 100644 index 0000000..de2826e Binary files /dev/null and b/art/animals/processed/sad_frog_reduced.png differ diff --git a/art/animals/processed/smile_dog_b.png b/art/animals/processed/smile_dog_b.png new file mode 100644 index 0000000..f12d699 Binary files /dev/null and b/art/animals/processed/smile_dog_b.png differ diff --git a/art/animals/processed/smile_dog_g.png b/art/animals/processed/smile_dog_g.png new file mode 100644 index 0000000..b110afe Binary files /dev/null and b/art/animals/processed/smile_dog_g.png differ diff --git a/art/animals/processed/smile_dog_r.png b/art/animals/processed/smile_dog_r.png new file mode 100644 index 0000000..1bed642 Binary files /dev/null and b/art/animals/processed/smile_dog_r.png differ diff --git a/art/animals/processed/smile_dog_reduced.png b/art/animals/processed/smile_dog_reduced.png new file mode 100644 index 0000000..ebc55a2 Binary files /dev/null and b/art/animals/processed/smile_dog_reduced.png differ diff --git a/art/animals/sad_frog.png b/art/animals/sad_frog.png new file mode 100644 index 0000000..8305e6f Binary files /dev/null and b/art/animals/sad_frog.png differ diff --git a/art/animals/smile_dog.jpg b/art/animals/smile_dog.jpg new file mode 100644 index 0000000..bb6c9d5 Binary files /dev/null and b/art/animals/smile_dog.jpg differ diff --git a/art/animals/smile_dog.png b/art/animals/smile_dog.png new file mode 100644 index 0000000..720175c Binary files /dev/null and b/art/animals/smile_dog.png differ diff --git a/art/ase/image2_b.ase b/art/ase/image2_b.ase new file mode 100644 index 0000000..f42356e Binary files /dev/null and b/art/ase/image2_b.ase differ diff --git a/art/ase/image_r.ase b/art/ase/image_r.ase new file mode 100644 index 0000000..0e0ecd1 Binary files /dev/null and b/art/ase/image_r.ase differ diff --git a/art/ase/palette.png b/art/ase/palette.png new file mode 100644 index 0000000..0af48a8 Binary files /dev/null and b/art/ase/palette.png differ diff --git a/art/color_changing_floor_tile_b.png b/art/color_changing_floor_tile_b.png new file mode 100644 index 0000000..6e43445 Binary files /dev/null and b/art/color_changing_floor_tile_b.png differ diff --git a/art/color_changing_floor_tile_g.png b/art/color_changing_floor_tile_g.png new file mode 100644 index 0000000..6e43445 Binary files /dev/null and b/art/color_changing_floor_tile_g.png differ diff --git a/art/color_changing_floor_tile_r.png b/art/color_changing_floor_tile_r.png new file mode 100644 index 0000000..6e43445 Binary files /dev/null and b/art/color_changing_floor_tile_r.png differ diff --git a/art/extract.sh b/art/extract.sh new file mode 100755 index 0000000..1dc0fe5 --- /dev/null +++ b/art/extract.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "extracting colors from $1..." + +NAME=`echo "$1" | cut -d'.' -f1` + +convert $1 -channel R -separate "${NAME}_r.png" +convert $1 -channel G -separate "${NAME}_g.png" +convert $1 -channel B -separate "${NAME}_b.png" + +echo "done!!!" \ No newline at end of file diff --git a/art/food/bread.png b/art/food/bread.png new file mode 100644 index 0000000..04d8e2e Binary files /dev/null and b/art/food/bread.png differ diff --git a/art/food/orig/bread.jpg b/art/food/orig/bread.jpg new file mode 100644 index 0000000..4c9198d Binary files /dev/null and b/art/food/orig/bread.jpg differ diff --git a/art/food/processed/apple_scaled_b.png b/art/food/processed/apple_scaled_b.png new file mode 100644 index 0000000..ddd3921 Binary files /dev/null and b/art/food/processed/apple_scaled_b.png differ diff --git a/art/food/processed/apple_scaled_g.png b/art/food/processed/apple_scaled_g.png new file mode 100644 index 0000000..5956d3a Binary files /dev/null and b/art/food/processed/apple_scaled_g.png differ diff --git a/art/food/processed/apple_scaled_r.png b/art/food/processed/apple_scaled_r.png new file mode 100644 index 0000000..6a2b570 Binary files /dev/null and b/art/food/processed/apple_scaled_r.png differ diff --git a/art/food/processed/apple_scaled_reduced.png b/art/food/processed/apple_scaled_reduced.png new file mode 100644 index 0000000..5cdedde Binary files /dev/null and b/art/food/processed/apple_scaled_reduced.png differ diff --git a/art/food/processed/banana_b.png b/art/food/processed/banana_b.png new file mode 100644 index 0000000..459a266 Binary files /dev/null and b/art/food/processed/banana_b.png differ diff --git a/art/food/processed/banana_g.png b/art/food/processed/banana_g.png new file mode 100644 index 0000000..f87f541 Binary files /dev/null and b/art/food/processed/banana_g.png differ diff --git a/art/food/processed/banana_r.png b/art/food/processed/banana_r.png new file mode 100644 index 0000000..66c51c8 Binary files /dev/null and b/art/food/processed/banana_r.png differ diff --git a/art/food/processed/banana_reduced.png b/art/food/processed/banana_reduced.png new file mode 100644 index 0000000..93de379 Binary files /dev/null and b/art/food/processed/banana_reduced.png differ diff --git a/art/food/processed/bread_b.png b/art/food/processed/bread_b.png new file mode 100644 index 0000000..8757d0c Binary files /dev/null and b/art/food/processed/bread_b.png differ diff --git a/art/food/processed/bread_g.png b/art/food/processed/bread_g.png new file mode 100644 index 0000000..2700004 Binary files /dev/null and b/art/food/processed/bread_g.png differ diff --git a/art/food/processed/bread_r.png b/art/food/processed/bread_r.png new file mode 100644 index 0000000..b0fb240 Binary files /dev/null and b/art/food/processed/bread_r.png differ diff --git a/art/food/processed/bread_reduced.png b/art/food/processed/bread_reduced.png new file mode 100644 index 0000000..72c6c5d Binary files /dev/null and b/art/food/processed/bread_reduced.png differ diff --git a/art/food/processed/grapefruit_b.png b/art/food/processed/grapefruit_b.png new file mode 100644 index 0000000..2d05c82 Binary files /dev/null and b/art/food/processed/grapefruit_b.png differ diff --git a/art/food/processed/grapefruit_g.png b/art/food/processed/grapefruit_g.png new file mode 100644 index 0000000..f3f75b2 Binary files /dev/null and b/art/food/processed/grapefruit_g.png differ diff --git a/art/food/processed/grapefruit_r.png b/art/food/processed/grapefruit_r.png new file mode 100644 index 0000000..58fdf10 Binary files /dev/null and b/art/food/processed/grapefruit_r.png differ diff --git a/art/food/processed/grapefruit_reduced.png b/art/food/processed/grapefruit_reduced.png new file mode 100644 index 0000000..ad930c1 Binary files /dev/null and b/art/food/processed/grapefruit_reduced.png differ diff --git a/art/food/processed/kiwi_b.png b/art/food/processed/kiwi_b.png new file mode 100644 index 0000000..5864df7 Binary files /dev/null and b/art/food/processed/kiwi_b.png differ diff --git a/art/food/processed/kiwi_g.png b/art/food/processed/kiwi_g.png new file mode 100644 index 0000000..ca68c75 Binary files /dev/null and b/art/food/processed/kiwi_g.png differ diff --git a/art/food/processed/kiwi_r.png b/art/food/processed/kiwi_r.png new file mode 100644 index 0000000..c856414 Binary files /dev/null and b/art/food/processed/kiwi_r.png differ diff --git a/art/food/processed/kiwi_reduced.png b/art/food/processed/kiwi_reduced.png new file mode 100644 index 0000000..7da7f3b Binary files /dev/null and b/art/food/processed/kiwi_reduced.png differ diff --git a/art/food/processed/palm_scaled_reduced.png b/art/food/processed/palm_scaled_reduced.png new file mode 100644 index 0000000..8c04070 Binary files /dev/null and b/art/food/processed/palm_scaled_reduced.png differ diff --git a/art/food/processed/wine_b.png b/art/food/processed/wine_b.png new file mode 100644 index 0000000..c6247d0 Binary files /dev/null and b/art/food/processed/wine_b.png differ diff --git a/art/food/processed/wine_g.png b/art/food/processed/wine_g.png new file mode 100644 index 0000000..c6247d0 Binary files /dev/null and b/art/food/processed/wine_g.png differ diff --git a/art/food/processed/wine_r.png b/art/food/processed/wine_r.png new file mode 100644 index 0000000..c7830ce Binary files /dev/null and b/art/food/processed/wine_r.png differ diff --git a/art/food/processed/wine_reduced.png b/art/food/processed/wine_reduced.png new file mode 100644 index 0000000..49ef980 Binary files /dev/null and b/art/food/processed/wine_reduced.png differ diff --git a/art/house/orig/table.png b/art/house/orig/table.png new file mode 100644 index 0000000..72b8920 Binary files /dev/null and b/art/house/orig/table.png differ diff --git a/art/house/processed/table_b.png b/art/house/processed/table_b.png new file mode 100644 index 0000000..5c5d3f4 Binary files /dev/null and b/art/house/processed/table_b.png differ diff --git a/art/house/processed/table_g.png b/art/house/processed/table_g.png new file mode 100644 index 0000000..84946a9 Binary files /dev/null and b/art/house/processed/table_g.png differ diff --git a/art/house/processed/table_r.png b/art/house/processed/table_r.png new file mode 100644 index 0000000..5236b50 Binary files /dev/null and b/art/house/processed/table_r.png differ diff --git a/art/house/processed/table_reduced.png b/art/house/processed/table_reduced.png new file mode 100644 index 0000000..0eb0686 Binary files /dev/null and b/art/house/processed/table_reduced.png differ diff --git a/art/house/table.png b/art/house/table.png new file mode 100644 index 0000000..80bee33 Binary files /dev/null and b/art/house/table.png differ diff --git a/art/image2_b.png b/art/image2_b.png new file mode 100644 index 0000000..be1d516 Binary files /dev/null and b/art/image2_b.png differ diff --git a/art/image2_g.png b/art/image2_g.png new file mode 100644 index 0000000..caa0c46 Binary files /dev/null and b/art/image2_g.png differ diff --git a/art/image2_r.png b/art/image2_r.png new file mode 100644 index 0000000..e6142ad Binary files /dev/null and b/art/image2_r.png differ diff --git a/art/image_b.png b/art/image_b.png new file mode 100644 index 0000000..d8d66a1 Binary files /dev/null and b/art/image_b.png differ diff --git a/art/image_g.png b/art/image_g.png new file mode 100644 index 0000000..f3a0ac9 Binary files /dev/null and b/art/image_g.png differ diff --git a/art/image_r.png b/art/image_r.png new file mode 100644 index 0000000..5863bbd Binary files /dev/null and b/art/image_r.png differ diff --git a/art/museum/adam_b.png b/art/museum/adam_b.png new file mode 100644 index 0000000..e7c64da Binary files /dev/null and b/art/museum/adam_b.png differ diff --git a/art/museum/adam_g.png b/art/museum/adam_g.png new file mode 100644 index 0000000..0462975 Binary files /dev/null and b/art/museum/adam_g.png differ diff --git a/art/museum/adam_r.png b/art/museum/adam_r.png new file mode 100644 index 0000000..4533b77 Binary files /dev/null and b/art/museum/adam_r.png differ diff --git a/art/museum/david_b.png b/art/museum/david_b.png new file mode 100644 index 0000000..e6ed577 Binary files /dev/null and b/art/museum/david_b.png differ diff --git a/art/museum/david_g.png b/art/museum/david_g.png new file mode 100644 index 0000000..0bebc3a Binary files /dev/null and b/art/museum/david_g.png differ diff --git a/art/museum/david_r.png b/art/museum/david_r.png new file mode 100644 index 0000000..94b4a83 Binary files /dev/null and b/art/museum/david_r.png differ diff --git a/art/museum/david_small_b.png b/art/museum/david_small_b.png new file mode 100644 index 0000000..01a2a03 Binary files /dev/null and b/art/museum/david_small_b.png differ diff --git a/art/museum/david_small_g.png b/art/museum/david_small_g.png new file mode 100644 index 0000000..0bd1df2 Binary files /dev/null and b/art/museum/david_small_g.png differ diff --git a/art/museum/david_small_r.png b/art/museum/david_small_r.png new file mode 100644 index 0000000..cbe0bc7 Binary files /dev/null and b/art/museum/david_small_r.png differ diff --git a/art/museum/lilypond_b.png b/art/museum/lilypond_b.png new file mode 100644 index 0000000..f415f61 Binary files /dev/null and b/art/museum/lilypond_b.png differ diff --git a/art/museum/lilypond_g.png b/art/museum/lilypond_g.png new file mode 100644 index 0000000..55dd0be Binary files /dev/null and b/art/museum/lilypond_g.png differ diff --git a/art/museum/lilypond_r.png b/art/museum/lilypond_r.png new file mode 100644 index 0000000..8ad3341 Binary files /dev/null and b/art/museum/lilypond_r.png differ diff --git a/art/museum/lisa_b.png b/art/museum/lisa_b.png new file mode 100644 index 0000000..6cbbc53 Binary files /dev/null and b/art/museum/lisa_b.png differ diff --git a/art/museum/lisa_g.png b/art/museum/lisa_g.png new file mode 100644 index 0000000..abe882a Binary files /dev/null and b/art/museum/lisa_g.png differ diff --git a/art/museum/lisa_r.png b/art/museum/lisa_r.png new file mode 100644 index 0000000..d5e7193 Binary files /dev/null and b/art/museum/lisa_r.png differ diff --git a/art/museum/palette.png b/art/museum/palette.png new file mode 100644 index 0000000..0af48a8 Binary files /dev/null and b/art/museum/palette.png differ diff --git a/art/museum/processed/lisa_b.png b/art/museum/processed/lisa_b.png new file mode 100644 index 0000000..6cbbc53 Binary files /dev/null and b/art/museum/processed/lisa_b.png differ diff --git a/art/museum/processed/lisa_g.png b/art/museum/processed/lisa_g.png new file mode 100644 index 0000000..abe882a Binary files /dev/null and b/art/museum/processed/lisa_g.png differ diff --git a/art/museum/processed/lisa_r.png b/art/museum/processed/lisa_r.png new file mode 100644 index 0000000..d5e7193 Binary files /dev/null and b/art/museum/processed/lisa_r.png differ diff --git a/art/museum/processed/the_scream_b.png b/art/museum/processed/the_scream_b.png new file mode 100644 index 0000000..8c99d03 Binary files /dev/null and b/art/museum/processed/the_scream_b.png differ diff --git a/art/museum/processed/the_scream_big_b.png b/art/museum/processed/the_scream_big_b.png new file mode 100644 index 0000000..4877958 Binary files /dev/null and b/art/museum/processed/the_scream_big_b.png differ diff --git a/art/museum/processed/the_scream_big_g.png b/art/museum/processed/the_scream_big_g.png new file mode 100644 index 0000000..3d3b97a Binary files /dev/null and b/art/museum/processed/the_scream_big_g.png differ diff --git a/art/museum/processed/the_scream_big_r.png b/art/museum/processed/the_scream_big_r.png new file mode 100644 index 0000000..b732059 Binary files /dev/null and b/art/museum/processed/the_scream_big_r.png differ diff --git a/art/museum/processed/the_scream_big_reduced.png b/art/museum/processed/the_scream_big_reduced.png new file mode 100644 index 0000000..2317fae Binary files /dev/null and b/art/museum/processed/the_scream_big_reduced.png differ diff --git a/art/museum/processed/the_scream_g.png b/art/museum/processed/the_scream_g.png new file mode 100644 index 0000000..f904a1b Binary files /dev/null and b/art/museum/processed/the_scream_g.png differ diff --git a/art/museum/processed/the_scream_r.png b/art/museum/processed/the_scream_r.png new file mode 100644 index 0000000..db8eecc Binary files /dev/null and b/art/museum/processed/the_scream_r.png differ diff --git a/art/museum/processed/the_scream_reduced.png b/art/museum/processed/the_scream_reduced.png new file mode 100644 index 0000000..6b8bfe4 Binary files /dev/null and b/art/museum/processed/the_scream_reduced.png differ diff --git a/art/museum/processed/the_scream_reduced_b.png b/art/museum/processed/the_scream_reduced_b.png new file mode 100644 index 0000000..6c7c805 Binary files /dev/null and b/art/museum/processed/the_scream_reduced_b.png differ diff --git a/art/museum/processed/the_scream_reduced_g.png b/art/museum/processed/the_scream_reduced_g.png new file mode 100644 index 0000000..d174206 Binary files /dev/null and b/art/museum/processed/the_scream_reduced_g.png differ diff --git a/art/museum/processed/the_scream_reduced_r.png b/art/museum/processed/the_scream_reduced_r.png new file mode 100644 index 0000000..17c4bdb Binary files /dev/null and b/art/museum/processed/the_scream_reduced_r.png differ diff --git a/art/museum/starry_b.png b/art/museum/starry_b.png new file mode 100644 index 0000000..b1e408a Binary files /dev/null and b/art/museum/starry_b.png differ diff --git a/art/museum/starry_g.png b/art/museum/starry_g.png new file mode 100644 index 0000000..a5bf217 Binary files /dev/null and b/art/museum/starry_g.png differ diff --git a/art/museum/starry_r.png b/art/museum/starry_r.png new file mode 100644 index 0000000..afee867 Binary files /dev/null and b/art/museum/starry_r.png differ diff --git a/art/museum/the_scream.jpg b/art/museum/the_scream.jpg new file mode 100644 index 0000000..2c03201 Binary files /dev/null and b/art/museum/the_scream.jpg differ diff --git a/art/museum/the_scream.png b/art/museum/the_scream.png new file mode 100644 index 0000000..6ca44f1 Binary files /dev/null and b/art/museum/the_scream.png differ diff --git a/art/museum/the_scream_b.png b/art/museum/the_scream_b.png new file mode 100644 index 0000000..8c99d03 Binary files /dev/null and b/art/museum/the_scream_b.png differ diff --git a/art/museum/the_scream_big.png b/art/museum/the_scream_big.png new file mode 100644 index 0000000..71facc7 Binary files /dev/null and b/art/museum/the_scream_big.png differ diff --git a/art/museum/the_scream_big_b.png b/art/museum/the_scream_big_b.png new file mode 100644 index 0000000..4877958 Binary files /dev/null and b/art/museum/the_scream_big_b.png differ diff --git a/art/museum/the_scream_big_g.png b/art/museum/the_scream_big_g.png new file mode 100644 index 0000000..3d3b97a Binary files /dev/null and b/art/museum/the_scream_big_g.png differ diff --git a/art/museum/the_scream_big_r.png b/art/museum/the_scream_big_r.png new file mode 100644 index 0000000..b732059 Binary files /dev/null and b/art/museum/the_scream_big_r.png differ diff --git a/art/museum/the_scream_g.png b/art/museum/the_scream_g.png new file mode 100644 index 0000000..f904a1b Binary files /dev/null and b/art/museum/the_scream_g.png differ diff --git a/art/museum/the_scream_r.png b/art/museum/the_scream_r.png new file mode 100644 index 0000000..db8eecc Binary files /dev/null and b/art/museum/the_scream_r.png differ diff --git a/art/museum/to_process/art.json b/art/museum/to_process/art.json new file mode 100644 index 0000000..3e4015f --- /dev/null +++ b/art/museum/to_process/art.json @@ -0,0 +1 @@ +{"snow_in_winter":{"red":"processed/snow_in_winter_r.png","green":"processed/snow_in_winter_g.png","blue":"processed/snow_in_winter_b.png"},"delacroix":{"blue":"processed/delacroix_b.png","green":"processed/delacroix_g.png","red":"processed/delacroix_r.png"},"birth_of_venus":{"blue":"processed/birth_of_venus_b.png","green":"processed/birth_of_venus_g.png","red":"processed/birth_of_venus_r.png"},"saturn_son":{"green":"processed/saturn_son_g.png","blue":"processed/saturn_son_b.png","red":"processed/saturn_son_r.png"}} \ No newline at end of file diff --git a/art/museum/to_process/birth_of_venus.jpg b/art/museum/to_process/birth_of_venus.jpg new file mode 100644 index 0000000..87bc717 Binary files /dev/null and b/art/museum/to_process/birth_of_venus.jpg differ diff --git a/art/museum/to_process/cropped/birth_of_venus.png b/art/museum/to_process/cropped/birth_of_venus.png new file mode 100644 index 0000000..7409424 Binary files /dev/null and b/art/museum/to_process/cropped/birth_of_venus.png differ diff --git a/art/museum/to_process/cropped/delacroix.png b/art/museum/to_process/cropped/delacroix.png new file mode 100644 index 0000000..c287de7 Binary files /dev/null and b/art/museum/to_process/cropped/delacroix.png differ diff --git a/art/museum/to_process/cropped/lisa.jpg b/art/museum/to_process/cropped/lisa.jpg new file mode 100644 index 0000000..00ff0ca Binary files /dev/null and b/art/museum/to_process/cropped/lisa.jpg differ diff --git a/art/museum/to_process/cropped/lisa.png b/art/museum/to_process/cropped/lisa.png new file mode 100644 index 0000000..222d41a Binary files /dev/null and b/art/museum/to_process/cropped/lisa.png differ diff --git a/art/museum/to_process/cropped/palette b/art/museum/to_process/cropped/palette new file mode 100644 index 0000000..0af48a8 Binary files /dev/null and b/art/museum/to_process/cropped/palette differ diff --git a/art/museum/to_process/cropped/pearl_earing.jpg b/art/museum/to_process/cropped/pearl_earing.jpg new file mode 100644 index 0000000..cdb782d Binary files /dev/null and b/art/museum/to_process/cropped/pearl_earing.jpg differ diff --git a/art/museum/to_process/cropped/pearl_earing.png b/art/museum/to_process/cropped/pearl_earing.png new file mode 100644 index 0000000..0994271 Binary files /dev/null and b/art/museum/to_process/cropped/pearl_earing.png differ diff --git a/art/museum/to_process/cropped/processed/birth_of_venus_b.png b/art/museum/to_process/cropped/processed/birth_of_venus_b.png new file mode 100644 index 0000000..99ed665 Binary files /dev/null and b/art/museum/to_process/cropped/processed/birth_of_venus_b.png differ diff --git a/art/museum/to_process/cropped/processed/birth_of_venus_g.png b/art/museum/to_process/cropped/processed/birth_of_venus_g.png new file mode 100644 index 0000000..118a2a9 Binary files /dev/null and b/art/museum/to_process/cropped/processed/birth_of_venus_g.png differ diff --git a/art/museum/to_process/cropped/processed/birth_of_venus_r.png b/art/museum/to_process/cropped/processed/birth_of_venus_r.png new file mode 100644 index 0000000..5eda5e6 Binary files /dev/null and b/art/museum/to_process/cropped/processed/birth_of_venus_r.png differ diff --git a/art/museum/to_process/cropped/processed/birth_of_venus_reduced.png b/art/museum/to_process/cropped/processed/birth_of_venus_reduced.png new file mode 100644 index 0000000..480466c Binary files /dev/null and b/art/museum/to_process/cropped/processed/birth_of_venus_reduced.png differ diff --git a/art/museum/to_process/cropped/processed/delacroix_b.png b/art/museum/to_process/cropped/processed/delacroix_b.png new file mode 100644 index 0000000..869a00b Binary files /dev/null and b/art/museum/to_process/cropped/processed/delacroix_b.png differ diff --git a/art/museum/to_process/cropped/processed/delacroix_g.png b/art/museum/to_process/cropped/processed/delacroix_g.png new file mode 100644 index 0000000..4f20d1e Binary files /dev/null and b/art/museum/to_process/cropped/processed/delacroix_g.png differ diff --git a/art/museum/to_process/cropped/processed/delacroix_r.png b/art/museum/to_process/cropped/processed/delacroix_r.png new file mode 100644 index 0000000..9164c76 Binary files /dev/null and b/art/museum/to_process/cropped/processed/delacroix_r.png differ diff --git a/art/museum/to_process/cropped/processed/delacroix_reduced.png b/art/museum/to_process/cropped/processed/delacroix_reduced.png new file mode 100644 index 0000000..8bbcb90 Binary files /dev/null and b/art/museum/to_process/cropped/processed/delacroix_reduced.png differ diff --git a/art/museum/to_process/cropped/processed/lisa_b.png b/art/museum/to_process/cropped/processed/lisa_b.png new file mode 100644 index 0000000..de0c310 Binary files /dev/null and b/art/museum/to_process/cropped/processed/lisa_b.png differ diff --git a/art/museum/to_process/cropped/processed/lisa_g.png b/art/museum/to_process/cropped/processed/lisa_g.png new file mode 100644 index 0000000..713db06 Binary files /dev/null and b/art/museum/to_process/cropped/processed/lisa_g.png differ diff --git a/art/museum/to_process/cropped/processed/lisa_r.png b/art/museum/to_process/cropped/processed/lisa_r.png new file mode 100644 index 0000000..6e27b17 Binary files /dev/null and b/art/museum/to_process/cropped/processed/lisa_r.png differ diff --git a/art/museum/to_process/cropped/processed/lisa_reduced.png b/art/museum/to_process/cropped/processed/lisa_reduced.png new file mode 100644 index 0000000..5ff7503 Binary files /dev/null and b/art/museum/to_process/cropped/processed/lisa_reduced.png differ diff --git a/art/museum/to_process/cropped/processed/pearl_earing_b.png b/art/museum/to_process/cropped/processed/pearl_earing_b.png new file mode 100644 index 0000000..df7f1cb Binary files /dev/null and b/art/museum/to_process/cropped/processed/pearl_earing_b.png differ diff --git a/art/museum/to_process/cropped/processed/pearl_earing_g.png b/art/museum/to_process/cropped/processed/pearl_earing_g.png new file mode 100644 index 0000000..45e4b24 Binary files /dev/null and b/art/museum/to_process/cropped/processed/pearl_earing_g.png differ diff --git a/art/museum/to_process/cropped/processed/pearl_earing_r.png b/art/museum/to_process/cropped/processed/pearl_earing_r.png new file mode 100644 index 0000000..169f651 Binary files /dev/null and b/art/museum/to_process/cropped/processed/pearl_earing_r.png differ diff --git a/art/museum/to_process/cropped/processed/pearl_earing_reduced.png b/art/museum/to_process/cropped/processed/pearl_earing_reduced.png new file mode 100644 index 0000000..2e0e4f4 Binary files /dev/null and b/art/museum/to_process/cropped/processed/pearl_earing_reduced.png differ diff --git a/art/museum/to_process/cropped/processed/saturn_son_b.png b/art/museum/to_process/cropped/processed/saturn_son_b.png new file mode 100644 index 0000000..9bff1e0 Binary files /dev/null and b/art/museum/to_process/cropped/processed/saturn_son_b.png differ diff --git a/art/museum/to_process/cropped/processed/saturn_son_g.png b/art/museum/to_process/cropped/processed/saturn_son_g.png new file mode 100644 index 0000000..114bc8a Binary files /dev/null and b/art/museum/to_process/cropped/processed/saturn_son_g.png differ diff --git a/art/museum/to_process/cropped/processed/saturn_son_r.png b/art/museum/to_process/cropped/processed/saturn_son_r.png new file mode 100644 index 0000000..7630220 Binary files /dev/null and b/art/museum/to_process/cropped/processed/saturn_son_r.png differ diff --git a/art/museum/to_process/cropped/processed/saturn_son_reduced.png b/art/museum/to_process/cropped/processed/saturn_son_reduced.png new file mode 100644 index 0000000..5aa9dfd Binary files /dev/null and b/art/museum/to_process/cropped/processed/saturn_son_reduced.png differ diff --git a/art/museum/to_process/cropped/processed/van_gogh_b.png b/art/museum/to_process/cropped/processed/van_gogh_b.png new file mode 100644 index 0000000..eb9b0e9 Binary files /dev/null and b/art/museum/to_process/cropped/processed/van_gogh_b.png differ diff --git a/art/museum/to_process/cropped/processed/van_gogh_g.png b/art/museum/to_process/cropped/processed/van_gogh_g.png new file mode 100644 index 0000000..eb4c1d9 Binary files /dev/null and b/art/museum/to_process/cropped/processed/van_gogh_g.png differ diff --git a/art/museum/to_process/cropped/processed/van_gogh_r.png b/art/museum/to_process/cropped/processed/van_gogh_r.png new file mode 100644 index 0000000..045dd45 Binary files /dev/null and b/art/museum/to_process/cropped/processed/van_gogh_r.png differ diff --git a/art/museum/to_process/cropped/processed/van_gogh_reduced.png b/art/museum/to_process/cropped/processed/van_gogh_reduced.png new file mode 100644 index 0000000..4988251 Binary files /dev/null and b/art/museum/to_process/cropped/processed/van_gogh_reduced.png differ diff --git a/art/museum/to_process/cropped/saturn_son.png b/art/museum/to_process/cropped/saturn_son.png new file mode 100644 index 0000000..4090820 Binary files /dev/null and b/art/museum/to_process/cropped/saturn_son.png differ diff --git a/art/museum/to_process/cropped/van_gogh.jpg b/art/museum/to_process/cropped/van_gogh.jpg new file mode 100644 index 0000000..667bd51 Binary files /dev/null and b/art/museum/to_process/cropped/van_gogh.jpg differ diff --git a/art/museum/to_process/cropped/van_gogh.png b/art/museum/to_process/cropped/van_gogh.png new file mode 100644 index 0000000..e01bf52 Binary files /dev/null and b/art/museum/to_process/cropped/van_gogh.png differ diff --git a/art/museum/to_process/delacroix.jpg b/art/museum/to_process/delacroix.jpg new file mode 100644 index 0000000..5bb9a63 Binary files /dev/null and b/art/museum/to_process/delacroix.jpg differ diff --git a/art/museum/to_process/palette b/art/museum/to_process/palette new file mode 100644 index 0000000..0af48a8 Binary files /dev/null and b/art/museum/to_process/palette differ diff --git a/art/museum/to_process/pixelate.js b/art/museum/to_process/pixelate.js new file mode 100644 index 0000000..5a72063 --- /dev/null +++ b/art/museum/to_process/pixelate.js @@ -0,0 +1,141 @@ +var gm = require('gm').subClass({ imageMagick: true }); +var fs = require('fs') +var path = require('path') + +var imageTypes = [".png", ".jpg", ".jpeg", ".bmp"] + +if (typeof process.argv[3] === 'undefined') + outDirectory = "processed/"; +else + outDirectory = process.argv[3]; + +var inDirectory = process.argv[2]; +var outDirectory; +var palette = "palette" +var channels = ["Red", "Green", "Blue"] + +var objToSerialize = { + //format: + + //name_of_picture: filename +} + + +var ratio = function(x, y) { + var div = x / y; + + var newRatio; + if (1.333 < div < 1.666) { + newRatio = 1.5 + } + else { + newRatio = Math.max(Math.min(Math.round(div), 3), 1) + } + + var newX = y * newRatio; + + if ( newX < x) { + x = newX; + } + else { + y = x / newRatio; + } + + return [x, y, newRatio] +} + +fs.readdir(inDirectory, function(err, files) { + files.forEach(function(file) { + if ( imageTypes.indexOf(path.extname(file)) > -1 ) { + + //lets put the filename in an object + var filename = file.split(".")[0] + + function processImage(filename, callbac, color) { + var img = gm(filename); + + var w; var h; var w_off; var h_off; + var ar_w; var ar_h; + var r; + var scale_w; var scale_h; + + + img.size(function(err, value) { + if (value) { + w = value.width; h = value.height; + if (w > h) { + var res = ratio(w, h) + ar_w = res[0]; + ar_h = res[1]; + r = res[2]; + + scale_w = 48 * r; + scale_h = 48; + } + else { + var res = ratio(h, w); + ar_w = res[1]; + ar_h = res[0]; + r = res[2]; + scale_w = 48; + scale_h = 48 * r; + } + if (w > ar_w) { + w_off = (w - ar_w) / 2; + h_off = 0; + } + else if (h > ar_h) { + w_off = 0; + h_off = (h - ar_h) / 2 + } + else { + w_off = 0; h_off = 0; + } + console.log(r); + } + callbac({ + img: img, color: color, w: w, h: h, w_off: w_off, h_off: h_off, ar_w: ar_w, + ar_h: ar_h, scale_w: scale_w, scale_h: scale_h + }); + }) + } + + function cropScaleMap(obj) { + obj.img.crop(obj.ar_w, obj.ar_h, obj.w_off, obj.h_off) + .scale(obj.scale_w, obj.scale_h) + // .map(palette) + // .dither(true) + // .channel(obj.color) + .write(outDirectory + filename + "_" + obj.color.charAt(0).toLowerCase() + ".png", function(err) { + + // console.log(err); + // console.log(outDirectory + filename + "_" + obj.color.charAt(0).toLowerCase() + ".png") + // var col = obj.color.toLowerCase() + // if (objToSerialize[filename]) { + // objToSerialize[filename][col] = outDirectory + filename + "_" + obj.color.charAt(0).toLowerCase() + ".png" + // } + // else { + // objToSerialize[filename] = {} + // objToSerialize[filename][col] = outDirectory + filename + "_" + obj.color.charAt(0).toLowerCase() + ".png" + // } + // fs.writeFile('art.json', JSON.stringify(objToSerialize), function(err) { + // if (err) throw err; + // console.log("wowwwww"); + // }); + }); + + } + + //do the stuff + for (var i = 0; i < channels.length; i++) { + // var c = channels[i]; + // var c_abb = channels[i].charAt(0).toLowerCase(); + + processImage(file, cropScaleMap, channels[i]) + } + } + }); + var s = JSON.stringify(objToSerialize); + console.log(s) +}); + diff --git a/art/museum/to_process/processed/adam_b.png b/art/museum/to_process/processed/adam_b.png new file mode 100644 index 0000000..e7c64da Binary files /dev/null and b/art/museum/to_process/processed/adam_b.png differ diff --git a/art/museum/to_process/processed/adam_g.png b/art/museum/to_process/processed/adam_g.png new file mode 100644 index 0000000..0462975 Binary files /dev/null and b/art/museum/to_process/processed/adam_g.png differ diff --git a/art/museum/to_process/processed/adam_r.png b/art/museum/to_process/processed/adam_r.png new file mode 100644 index 0000000..4533b77 Binary files /dev/null and b/art/museum/to_process/processed/adam_r.png differ diff --git a/art/museum/to_process/processed/adam_reduced.png b/art/museum/to_process/processed/adam_reduced.png new file mode 100644 index 0000000..19f04bb Binary files /dev/null and b/art/museum/to_process/processed/adam_reduced.png differ diff --git a/art/museum/to_process/processed/david_b.png b/art/museum/to_process/processed/david_b.png new file mode 100644 index 0000000..e6ed577 Binary files /dev/null and b/art/museum/to_process/processed/david_b.png differ diff --git a/art/museum/to_process/processed/david_g.png b/art/museum/to_process/processed/david_g.png new file mode 100644 index 0000000..0bebc3a Binary files /dev/null and b/art/museum/to_process/processed/david_g.png differ diff --git a/art/museum/to_process/processed/david_r.png b/art/museum/to_process/processed/david_r.png new file mode 100644 index 0000000..94b4a83 Binary files /dev/null and b/art/museum/to_process/processed/david_r.png differ diff --git a/art/museum/to_process/processed/david_reduced.png b/art/museum/to_process/processed/david_reduced.png new file mode 100644 index 0000000..cdb3bec Binary files /dev/null and b/art/museum/to_process/processed/david_reduced.png differ diff --git a/art/museum/to_process/processed/david_small_b.png b/art/museum/to_process/processed/david_small_b.png new file mode 100644 index 0000000..01a2a03 Binary files /dev/null and b/art/museum/to_process/processed/david_small_b.png differ diff --git a/art/museum/to_process/processed/david_small_g.png b/art/museum/to_process/processed/david_small_g.png new file mode 100644 index 0000000..0bd1df2 Binary files /dev/null and b/art/museum/to_process/processed/david_small_g.png differ diff --git a/art/museum/to_process/processed/david_small_r.png b/art/museum/to_process/processed/david_small_r.png new file mode 100644 index 0000000..cbe0bc7 Binary files /dev/null and b/art/museum/to_process/processed/david_small_r.png differ diff --git a/art/museum/to_process/processed/david_small_reduced.png b/art/museum/to_process/processed/david_small_reduced.png new file mode 100644 index 0000000..d17be93 Binary files /dev/null and b/art/museum/to_process/processed/david_small_reduced.png differ diff --git a/art/museum/to_process/processed/lilypond_b.png b/art/museum/to_process/processed/lilypond_b.png new file mode 100644 index 0000000..f415f61 Binary files /dev/null and b/art/museum/to_process/processed/lilypond_b.png differ diff --git a/art/museum/to_process/processed/lilypond_g.png b/art/museum/to_process/processed/lilypond_g.png new file mode 100644 index 0000000..55dd0be Binary files /dev/null and b/art/museum/to_process/processed/lilypond_g.png differ diff --git a/art/museum/to_process/processed/lilypond_r.png b/art/museum/to_process/processed/lilypond_r.png new file mode 100644 index 0000000..8ad3341 Binary files /dev/null and b/art/museum/to_process/processed/lilypond_r.png differ diff --git a/art/museum/to_process/processed/lilypond_reduced.png b/art/museum/to_process/processed/lilypond_reduced.png new file mode 100644 index 0000000..556ffee Binary files /dev/null and b/art/museum/to_process/processed/lilypond_reduced.png differ diff --git a/art/museum/to_process/processed/starry_b.png b/art/museum/to_process/processed/starry_b.png new file mode 100644 index 0000000..b1e408a Binary files /dev/null and b/art/museum/to_process/processed/starry_b.png differ diff --git a/art/museum/to_process/processed/starry_g.png b/art/museum/to_process/processed/starry_g.png new file mode 100644 index 0000000..a5bf217 Binary files /dev/null and b/art/museum/to_process/processed/starry_g.png differ diff --git a/art/museum/to_process/processed/starry_r.png b/art/museum/to_process/processed/starry_r.png new file mode 100644 index 0000000..afee867 Binary files /dev/null and b/art/museum/to_process/processed/starry_r.png differ diff --git a/art/museum/to_process/processed/starry_reduced.png b/art/museum/to_process/processed/starry_reduced.png new file mode 100644 index 0000000..aadcd65 Binary files /dev/null and b/art/museum/to_process/processed/starry_reduced.png differ diff --git a/art/museum/to_process/processed/venus_b.png b/art/museum/to_process/processed/venus_b.png new file mode 100644 index 0000000..f791445 Binary files /dev/null and b/art/museum/to_process/processed/venus_b.png differ diff --git a/art/museum/to_process/processed/venus_g.png b/art/museum/to_process/processed/venus_g.png new file mode 100644 index 0000000..f0ae6c9 Binary files /dev/null and b/art/museum/to_process/processed/venus_g.png differ diff --git a/art/museum/to_process/processed/venus_r.png b/art/museum/to_process/processed/venus_r.png new file mode 100644 index 0000000..baf794d Binary files /dev/null and b/art/museum/to_process/processed/venus_r.png differ diff --git a/art/museum/to_process/processed/venus_reduced.png b/art/museum/to_process/processed/venus_reduced.png new file mode 100644 index 0000000..82a8422 Binary files /dev/null and b/art/museum/to_process/processed/venus_reduced.png differ diff --git a/art/museum/to_process/saturn_son.jpg b/art/museum/to_process/saturn_son.jpg new file mode 100644 index 0000000..59d1318 Binary files /dev/null and b/art/museum/to_process/saturn_son.jpg differ diff --git a/art/museum/to_process/snow_in_winter.jpg b/art/museum/to_process/snow_in_winter.jpg new file mode 100644 index 0000000..15c2d6f Binary files /dev/null and b/art/museum/to_process/snow_in_winter.jpg differ diff --git a/art/museum/venus_b.png b/art/museum/venus_b.png new file mode 100644 index 0000000..f791445 Binary files /dev/null and b/art/museum/venus_b.png differ diff --git a/art/museum/venus_g.png b/art/museum/venus_g.png new file mode 100644 index 0000000..f0ae6c9 Binary files /dev/null and b/art/museum/venus_g.png differ diff --git a/art/museum/venus_r.png b/art/museum/venus_r.png new file mode 100644 index 0000000..baf794d Binary files /dev/null and b/art/museum/venus_r.png differ diff --git a/art/nature/apple_scaled.png b/art/nature/apple_scaled.png new file mode 100644 index 0000000..9de3230 Binary files /dev/null and b/art/nature/apple_scaled.png differ diff --git a/art/nature/banana.png b/art/nature/banana.png new file mode 100644 index 0000000..6267d7a Binary files /dev/null and b/art/nature/banana.png differ diff --git a/art/nature/flower_vase.png b/art/nature/flower_vase.png new file mode 100644 index 0000000..b697a52 Binary files /dev/null and b/art/nature/flower_vase.png differ diff --git a/art/nature/grapefruit.png b/art/nature/grapefruit.png new file mode 100644 index 0000000..5d53e64 Binary files /dev/null and b/art/nature/grapefruit.png differ diff --git a/art/nature/kiwi.png b/art/nature/kiwi.png new file mode 100644 index 0000000..0941f66 Binary files /dev/null and b/art/nature/kiwi.png differ diff --git a/art/nature/orig/apple.png b/art/nature/orig/apple.png new file mode 100644 index 0000000..1b67652 Binary files /dev/null and b/art/nature/orig/apple.png differ diff --git a/art/nature/orig/banana.png b/art/nature/orig/banana.png new file mode 100644 index 0000000..97ee07d Binary files /dev/null and b/art/nature/orig/banana.png differ diff --git a/art/nature/orig/flower_vase.jpg b/art/nature/orig/flower_vase.jpg new file mode 100644 index 0000000..8461b48 Binary files /dev/null and b/art/nature/orig/flower_vase.jpg differ diff --git a/art/nature/orig/flower_vase.png b/art/nature/orig/flower_vase.png new file mode 100644 index 0000000..fc42e74 Binary files /dev/null and b/art/nature/orig/flower_vase.png differ diff --git a/art/nature/orig/grapefruit.jpg b/art/nature/orig/grapefruit.jpg new file mode 100644 index 0000000..be73204 Binary files /dev/null and b/art/nature/orig/grapefruit.jpg differ diff --git a/art/nature/orig/kiwi.jpg b/art/nature/orig/kiwi.jpg new file mode 100644 index 0000000..086cfd5 Binary files /dev/null and b/art/nature/orig/kiwi.jpg differ diff --git a/art/nature/orig/kiwi.png b/art/nature/orig/kiwi.png new file mode 100644 index 0000000..63340aa Binary files /dev/null and b/art/nature/orig/kiwi.png differ diff --git a/art/nature/orig/palm.png b/art/nature/orig/palm.png new file mode 100644 index 0000000..20fc5a7 Binary files /dev/null and b/art/nature/orig/palm.png differ diff --git a/art/nature/orig/water.jpg b/art/nature/orig/water.jpg new file mode 100644 index 0000000..ebdd83d Binary files /dev/null and b/art/nature/orig/water.jpg differ diff --git a/art/nature/orig/wine.png b/art/nature/orig/wine.png new file mode 100644 index 0000000..8bd4a94 Binary files /dev/null and b/art/nature/orig/wine.png differ diff --git a/art/nature/palette b/art/nature/palette new file mode 100644 index 0000000..0af48a8 Binary files /dev/null and b/art/nature/palette differ diff --git a/art/nature/palm_scaled.png b/art/nature/palm_scaled.png new file mode 100644 index 0000000..f338694 Binary files /dev/null and b/art/nature/palm_scaled.png differ diff --git a/art/nature/processed/flower_vase_b.png b/art/nature/processed/flower_vase_b.png new file mode 100644 index 0000000..17c32ca Binary files /dev/null and b/art/nature/processed/flower_vase_b.png differ diff --git a/art/nature/processed/flower_vase_g.png b/art/nature/processed/flower_vase_g.png new file mode 100644 index 0000000..26150af Binary files /dev/null and b/art/nature/processed/flower_vase_g.png differ diff --git a/art/nature/processed/flower_vase_r.png b/art/nature/processed/flower_vase_r.png new file mode 100644 index 0000000..00cf753 Binary files /dev/null and b/art/nature/processed/flower_vase_r.png differ diff --git a/art/nature/processed/flower_vase_reduced.png b/art/nature/processed/flower_vase_reduced.png new file mode 100644 index 0000000..e9280d5 Binary files /dev/null and b/art/nature/processed/flower_vase_reduced.png differ diff --git a/art/nature/processed/palm_scaled_b.png b/art/nature/processed/palm_scaled_b.png new file mode 100644 index 0000000..4620c40 Binary files /dev/null and b/art/nature/processed/palm_scaled_b.png differ diff --git a/art/nature/processed/palm_scaled_g.png b/art/nature/processed/palm_scaled_g.png new file mode 100644 index 0000000..7e1fd0c Binary files /dev/null and b/art/nature/processed/palm_scaled_g.png differ diff --git a/art/nature/processed/palm_scaled_r.png b/art/nature/processed/palm_scaled_r.png new file mode 100644 index 0000000..c5e048a Binary files /dev/null and b/art/nature/processed/palm_scaled_r.png differ diff --git a/art/nature/processed/water_b.png b/art/nature/processed/water_b.png new file mode 100644 index 0000000..76346c5 Binary files /dev/null and b/art/nature/processed/water_b.png differ diff --git a/art/nature/processed/water_g.png b/art/nature/processed/water_g.png new file mode 100644 index 0000000..a0c8b4d Binary files /dev/null and b/art/nature/processed/water_g.png differ diff --git a/art/nature/processed/water_r.png b/art/nature/processed/water_r.png new file mode 100644 index 0000000..47051aa Binary files /dev/null and b/art/nature/processed/water_r.png differ diff --git a/art/nature/processed/water_reduced.png b/art/nature/processed/water_reduced.png new file mode 100644 index 0000000..ea3492f Binary files /dev/null and b/art/nature/processed/water_reduced.png differ diff --git a/art/nature/water.png b/art/nature/water.png new file mode 100644 index 0000000..d49e6c8 Binary files /dev/null and b/art/nature/water.png differ diff --git a/art/nature/wine.png b/art/nature/wine.png new file mode 100644 index 0000000..13cb972 Binary files /dev/null and b/art/nature/wine.png differ diff --git a/art/palette b/art/palette new file mode 100644 index 0000000..0af48a8 Binary files /dev/null and b/art/palette differ diff --git a/art/palette.png b/art/palette.png new file mode 100644 index 0000000..0af48a8 Binary files /dev/null and b/art/palette.png differ diff --git a/art/process/cone.png b/art/process/cone.png new file mode 100644 index 0000000..1d2146a Binary files /dev/null and b/art/process/cone.png differ diff --git a/art/process/kanashi.png b/art/process/kanashi.png new file mode 100644 index 0000000..fed0a7f Binary files /dev/null and b/art/process/kanashi.png differ diff --git a/art/process/kinoko.png b/art/process/kinoko.png new file mode 100644 index 0000000..0e84dc0 Binary files /dev/null and b/art/process/kinoko.png differ diff --git a/art/process/lisa.png b/art/process/lisa.png new file mode 100644 index 0000000..94f325f Binary files /dev/null and b/art/process/lisa.png differ diff --git a/art/reduce_and_extract.sh b/art/reduce_and_extract.sh new file mode 100755 index 0000000..c497155 --- /dev/null +++ b/art/reduce_and_extract.sh @@ -0,0 +1,20 @@ +mkdir -p processed + +for f in *.png +do + NAME=`echo "$f" | cut -d'.' -f1` + + echo "mapping $f to palette..." + + convert $f +dither -map ../palette "processed/${NAME}_reduced.png" + + TARGET="processed/${NAME}_reduced.png" + + echo "extracting colors from $f..." + + convert $TARGET -channel R -separate "processed/${NAME}_r.png" + convert $TARGET -channel G -separate "processed/${NAME}_g.png" + convert $TARGET -channel B -separate "processed/${NAME}_b.png" + + echo "done!!!" +done diff --git a/art/reduce_colors.sh b/art/reduce_colors.sh new file mode 100644 index 0000000..386064a --- /dev/null +++ b/art/reduce_colors.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +mkdir -p processed +convert $1 +dither -map palette.png processed/ diff --git a/art/tech/cd.png b/art/tech/cd.png new file mode 100644 index 0000000..857cce0 Binary files /dev/null and b/art/tech/cd.png differ diff --git a/art/tech/ipod.png b/art/tech/ipod.png new file mode 100644 index 0000000..38ab216 Binary files /dev/null and b/art/tech/ipod.png differ diff --git a/art/tech/mac.png b/art/tech/mac.png new file mode 100644 index 0000000..a949baf Binary files /dev/null and b/art/tech/mac.png differ diff --git a/art/tech/mac_smaller.png b/art/tech/mac_smaller.png new file mode 100644 index 0000000..9710106 Binary files /dev/null and b/art/tech/mac_smaller.png differ diff --git a/art/tech/orig/cd.jpg b/art/tech/orig/cd.jpg new file mode 100644 index 0000000..1db0fb5 Binary files /dev/null and b/art/tech/orig/cd.jpg differ diff --git a/art/tech/orig/image.jpg b/art/tech/orig/image.jpg new file mode 100644 index 0000000..111f7c0 Binary files /dev/null and b/art/tech/orig/image.jpg differ diff --git a/art/tech/orig/ipod.jpg b/art/tech/orig/ipod.jpg new file mode 100644 index 0000000..71c9647 Binary files /dev/null and b/art/tech/orig/ipod.jpg differ diff --git a/art/tech/orig/mac.jpg b/art/tech/orig/mac.jpg new file mode 100644 index 0000000..283974f Binary files /dev/null and b/art/tech/orig/mac.jpg differ diff --git a/art/tech/orig/mac.png b/art/tech/orig/mac.png new file mode 100644 index 0000000..257edaa Binary files /dev/null and b/art/tech/orig/mac.png differ diff --git a/art/tech/processed/cd_b.png b/art/tech/processed/cd_b.png new file mode 100644 index 0000000..93c13ea Binary files /dev/null and b/art/tech/processed/cd_b.png differ diff --git a/art/tech/processed/cd_g.png b/art/tech/processed/cd_g.png new file mode 100644 index 0000000..cc068c7 Binary files /dev/null and b/art/tech/processed/cd_g.png differ diff --git a/art/tech/processed/cd_r.png b/art/tech/processed/cd_r.png new file mode 100644 index 0000000..a742131 Binary files /dev/null and b/art/tech/processed/cd_r.png differ diff --git a/art/tech/processed/cd_reduced.png b/art/tech/processed/cd_reduced.png new file mode 100644 index 0000000..9b28e4c Binary files /dev/null and b/art/tech/processed/cd_reduced.png differ diff --git a/art/tech/processed/ipod_b.png b/art/tech/processed/ipod_b.png new file mode 100644 index 0000000..d95e885 Binary files /dev/null and b/art/tech/processed/ipod_b.png differ diff --git a/art/tech/processed/ipod_g.png b/art/tech/processed/ipod_g.png new file mode 100644 index 0000000..8207c62 Binary files /dev/null and b/art/tech/processed/ipod_g.png differ diff --git a/art/tech/processed/ipod_r.png b/art/tech/processed/ipod_r.png new file mode 100644 index 0000000..8207c62 Binary files /dev/null and b/art/tech/processed/ipod_r.png differ diff --git a/art/tech/processed/ipod_reduced.png b/art/tech/processed/ipod_reduced.png new file mode 100644 index 0000000..02877cf Binary files /dev/null and b/art/tech/processed/ipod_reduced.png differ diff --git a/art/tech/processed/mac_b.png b/art/tech/processed/mac_b.png new file mode 100644 index 0000000..7db4299 Binary files /dev/null and b/art/tech/processed/mac_b.png differ diff --git a/art/tech/processed/mac_g.png b/art/tech/processed/mac_g.png new file mode 100644 index 0000000..70af8e4 Binary files /dev/null and b/art/tech/processed/mac_g.png differ diff --git a/art/tech/processed/mac_r.png b/art/tech/processed/mac_r.png new file mode 100644 index 0000000..2bfe308 Binary files /dev/null and b/art/tech/processed/mac_r.png differ diff --git a/art/tech/processed/mac_reduced.png b/art/tech/processed/mac_reduced.png new file mode 100644 index 0000000..fb5802d Binary files /dev/null and b/art/tech/processed/mac_reduced.png differ diff --git a/art/tech/processed/mac_smaller_b.png b/art/tech/processed/mac_smaller_b.png new file mode 100644 index 0000000..5234e28 Binary files /dev/null and b/art/tech/processed/mac_smaller_b.png differ diff --git a/art/tech/processed/mac_smaller_g.png b/art/tech/processed/mac_smaller_g.png new file mode 100644 index 0000000..826804c Binary files /dev/null and b/art/tech/processed/mac_smaller_g.png differ diff --git a/art/tech/processed/mac_smaller_r.png b/art/tech/processed/mac_smaller_r.png new file mode 100644 index 0000000..17ecc78 Binary files /dev/null and b/art/tech/processed/mac_smaller_r.png differ diff --git a/art/tech/processed/mac_smaller_reduced.png b/art/tech/processed/mac_smaller_reduced.png new file mode 100644 index 0000000..47f0e38 Binary files /dev/null and b/art/tech/processed/mac_smaller_reduced.png differ diff --git a/artifact.lua b/artifact.lua new file mode 100644 index 0000000..21aff5b --- /dev/null +++ b/artifact.lua @@ -0,0 +1,16 @@ +require "entity" + +Artifact = class("Artifact", Entity) + +function Artifact:initialize(x, y, color) + print(artifactSprite:getWidth(), artifactSprite:getHeight()) + Entity.initialize(self, { + x = x, + y = y, + sizeX = artifactSprite:getWidth() / 16, + sizeY = artifactSprite:getHeight() / 16, + color = color, + collision = "unmoveable", --player can't push other player + sprite = artifactSprite + }) +end \ No newline at end of file diff --git a/assorted.lua b/assorted.lua new file mode 100644 index 0000000..e160d5f --- /dev/null +++ b/assorted.lua @@ -0,0 +1,14 @@ +require "entity" + +Ass = class("Ass", Entity) + +function Ass:initialize(x, y, color, folder, name) + local spr = love.graphics.newImage("art/" .. folder .. name .. "_" .. string.lower(string.sub(color, 1, 1)) ..".png") + Entity.initialize(self, { + x = x, + y = y, + color = color, + collision = "moveable", --player can't push other player + sprite = spr + }) +end diff --git a/conf.lua b/conf.lua index a6a8ce4..95c9562 100644 --- a/conf.lua +++ b/conf.lua @@ -1,5 +1,5 @@ function love.conf(t) - t.window.width = 640 - t.window.height = 640 + t.window.width = 700 + t.window.height = 700 t.window.title = "CHROMA SOLSTICE" end \ No newline at end of file diff --git a/entity.lua b/entity.lua index 3887103..52f1d99 100644 --- a/entity.lua +++ b/entity.lua @@ -2,7 +2,8 @@ Entity = class("Entity") function Entity:initialize(t) self.x, self.y = t.x, t.y - self.size = {x = t.sizeX, y = t.sizeY} + self.spriteSize = {w = t.sprite:getWidth(), h = t.sprite:getHeight()} + self.size = {w = self.spriteSize.w / 16, h = self.spriteSize.h / 16} self.color = Color:new(t.color) self.collision = t.collision --"none", "moveable", "unmoveable" self.sprite = t.sprite @@ -11,12 +12,18 @@ end function Entity:atGridPos(x, y) -- print(x, y, self.x, self.y, self.x + self.size.x, self.y + self.size.y) - if x >= self.x and y >= self.y and x < self.x + self.size.y and y < self.y + self.size.y then + local size = self:getGridSize() + if x >= self.x and y >= self.y and x < self.x + size.x and y < self.y + size.y then return true end return false end +function Entity:getDrawBox() + local drawPos = self:getDrawPos() + return {x = drawPos.x, y = drawPos.y, w = self.spriteSize.w * drawScale, h = self.spriteSize.h * drawScale} +end + function Entity:getGridPos() return {x = self.x, y = self.y} end @@ -24,11 +31,15 @@ end function Entity:getDrawPos() local gridPos = self:getGridPos() return { - x = (gridPos.x - 1) * width / gridWidth, - y = (gridPos.y - 1) * height / gridHeight + x = (gridPos.x - 1) * width / gridWidth + self:sha(), + y = (gridPos.y - 1) * height / gridHeight + self:sha() } end +function Entity:getGridSize() + return {x = self.size.w, y = self.size.h} +end + function Entity:tick() end @@ -36,12 +47,12 @@ end function Entity:draw() love.graphics.setColor(self.color:set()) local p = self:getDrawPos() - love.graphics.draw(self.sprite, p.x + self:sha(), p.y + self:sha(), 0, drawScale, drawScale) + love.graphics.draw(self.sprite, p.x, p.y, 0, drawScale, drawScale) end function Entity:isAlignedWithPlayerMovement(axis, pos, direction) -- print(axis, pos[axis], self:getGridPos()[axis], self:getGridPos()[axis] + self.size[axis]) - if self:getGridPos()[axis] <= pos[axis] and self:getGridPos()[axis] + self.size[axis] > pos[axis] then + if self:getGridPos()[axis] <= pos[axis] and self:getGridPos()[axis] + self:getGridSize()[axis] > pos[axis] then print("true!!") return true end @@ -62,5 +73,5 @@ end function Entity:sha() - return math.random(-self.shaAmount, self.shaAmount) * .5 + return math.random(-worldSha, worldSha) * .5 end \ No newline at end of file diff --git a/libs/json4lua b/libs/json4lua new file mode 160000 index 0000000..40fb13b --- /dev/null +++ b/libs/json4lua @@ -0,0 +1 @@ +Subproject commit 40fb13b0ec4a70e36f88812848511c5867bed857 diff --git a/libs/sfxrlua b/libs/sfxrlua new file mode 160000 index 0000000..7a542bb --- /dev/null +++ b/libs/sfxrlua @@ -0,0 +1 @@ +Subproject commit 7a542bb53151c0c9596c7b7fdfad096fe81d728a diff --git a/main.lua b/main.lua index 205eefd..1e557d9 100644 --- a/main.lua +++ b/main.lua @@ -1,6 +1,8 @@ class = require "libs/middleclass" Timer = require "libs/hump/timer" sfxr = require "libs/sfxrlua/sfxr" +json = require "libs/json4lua/json/json" +require "_helpers" require "input" require "color" require "room" @@ -20,17 +22,19 @@ function love.load() currentRoom = Room:new{ player = { - red = {x = 3, y = 5}, - green = {x = 4, y = 3}, - blue = {x = 3, y = 10} + red = {x = 5, y = 5}, + green = {x = 5, y = 5}, + blue = {x = 5, y = 5} } } end function love.update(dt) Input:handler() - currentRoom:update() + + if love.keyboard.isDown("w") then worldSha = worldSha + 1 end + if love.keyboard.isDown("s") then worldSha = worldSha - 1 end end function love.draw() @@ -75,6 +79,12 @@ function love.keypressed(key) local c = Input.playerColor(key) currentRoom:switchPlayer(c) end + if key == "w" then + worldSha = worldSha + 1 + end + if key == "s" then + worldSha = worldSha - 1 + end end function _initDefaults() @@ -97,6 +107,8 @@ end function _initGridVars() gridWidth, gridHeight = 11, 11 drawScale = width / gridWidth / 16 + + worldSha = 1 end function _initSounds() @@ -123,6 +135,35 @@ function loadSprites() green = love.graphics.newImage("art/wall_g.png"), blue = love.graphics.newImage("art/wall_b.png") } + waterSprite = { + red = love.graphics.newImage("art/nature/processed/water_r.png"), + green = love.graphics.newImage("art/nature/processed/water_g.png"), + blue = love.graphics.newImage("art/nature/processed/water_b.png") + } + npcSprites = { + + } + + -- local artPieceJsonString + -- for line in io.lines("art/museum/to_process/art.json") do + -- artPieceJsonString = line + -- end + + -- artPieceSpritesTable = json.decode(artPieceJsonString) + -- print(artPieceSpritesTable["saturn_son"]["red"]) + -- print(artSpriteJson) + -- -- sets the default input file as test.lua + -- io.input(artSpriteJson) + + -- -- prints the first line of the file + -- artSpriteJsonString = io.read() + + -- -- closes the open file + -- io.close(artSpriteJson) + + -- artSpriteTable = json.decode(artSpriteJsonString) + + -- print(artSpriteTable) artifactSprite = love.graphics.newImage("art/process/cone.png") end \ No newline at end of file diff --git a/npc.lua b/npc.lua new file mode 100644 index 0000000..4d9f972 --- /dev/null +++ b/npc.lua @@ -0,0 +1,11 @@ +npc = class("npc", Entity) + +function npc:initialize(x, y, color, name) + Entity.initialize(self, { + x = x, + y = y, + color = color, + collision = "none", --player can't push other player + sprite = npcSprites[name][color] + }) +end \ No newline at end of file diff --git a/room.lua b/room.lua index 1340adf..562e7da 100644 --- a/room.lua +++ b/room.lua @@ -4,6 +4,9 @@ require "player" require "box" require "wall" require "artifact" +require "npc" +require "art" +require "assorted" function Room:initialize(t) self.exits = t.exits @@ -24,20 +27,33 @@ function Room:initialize(t) self.activeColors[color] = true end - for i=0, 10 do + for i=0, 5 do local c = randomColor() local x, y = math.random(1, gridWidth), math.random(1, gridHeight) self.collideables[c]["b: " .. x .. ", " .. y] = Box:new(x, y, c) end - for i=0, 10 do - local c = randomColor() + for i=0, 5 do local x, y = math.random(1, gridWidth), math.random(1, gridHeight) - self.collideables[c]["w: " .. x .. ", " .. y] = Wall:new(x, y, c) + for color, active in pairs(self.activeColors) do + self.collideables[color]["w: " .. x .. ", " .. y] = Wall:new(x, y, color) + end end - self.collideables["green"]["fpp"] = Artifact:new(6, 6, "green") + -- 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 self.collideables[color]["n: " .. x .. ", " .. y] = Ass:new(x, y, color, "tech/processed/", "mac_smaller") end + + -- local x, y = 7, 7 + -- if active then self.collideables[color]["n: " .. x .. ", " .. y] = Ass:new(x, y, color, "tech/processed/", "cd") end + + -- end + + -- self.collideables["green"]["fpp"] = Artifact:new(6, 6, "green") end @@ -162,11 +178,13 @@ end function Room:tryPlayerMove(entities, pos, axis, direction) local counter = direction local entitiesToMove = {} + local origPosAxis = pos[axis] for _, entity in ipairs(entities) do pos[axis] = pos[axis] + direction + print(pos[axis]) + print(origPosAxis + counter) if entity:atGridPos(pos.x, pos.y) then - print("HOW????" .. entity) if entity:canMove() then table.insert(entitiesToMove, entity) else @@ -174,7 +192,7 @@ function Room:tryPlayerMove(entities, pos, axis, direction) return false end else - -- break + break end counter = counter + direction end @@ -182,6 +200,7 @@ function Room:tryPlayerMove(entities, pos, axis, direction) for _, entity in ipairs(entitiesToMove) do entity:move(axis, direction) end + print("wowe true") return true end diff --git a/shaders.lua b/shaders.lua new file mode 100644 index 0000000..254c9bb --- /dev/null +++ b/shaders.lua @@ -0,0 +1,31 @@ +wiggle = love.graphics.newShader[[ + + extern number seed; + extern number amount; + + + int grain = 10; //higher = less, lower = more + + float rand(vec2 co){ + return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); + } + + vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords) { + vec4 pixel_me = Texel(texture, texture_coords ); + + return Texel(texture, texture_coords + (rand(texture_coords * seed) - .5) * amount); + /* + int resolution = int(12 * 1 / zoom); + + vec2 final_coords = floor((resolution * texture_coords) + 0.5) / resolution; + + vec4 averaged_pixel = (Texel(texture, final_coords - (1 / resolution)) + Texel(texture, final_coords)) / 2 + (rand(final_coords * seed) / grain); + + averaged_pixel.a = 1; + + pixel_me = Texel(texture, final_coords); + + return averaged_pixel; + */ + } +]]