Commit Graph

255 Commits

Author SHA1 Message Date
Max Bradbury f4b82c3a67 missing field 2020-04-23 16:42:01 +01:00
Max Bradbury f2ec5d44bd add line endings property so we can convert later 2020-04-23 12:07:45 +01:00
Max Bradbury 096eb39bf6 optional version handling 2020-04-23 12:03:39 +01:00
Max Bradbury 6e7240e2d7 streamline this 2020-04-23 08:57:46 +01:00
Max Bradbury d1254988bc allow game to have font data (not really parsed for now) 2020-04-23 07:43:52 +01:00
Max Bradbury f740496727 don't strip newlines from endings 2020-04-23 06:57:07 +01:00
Max Bradbury d955f4ee71 fix ending from string (allow "END " in dialogue, and multi-line dialogues) 2020-04-23 06:50:38 +01:00
Max Bradbury 7a8ec4e5d2 fix executable name 2020-04-19 08:14:52 +01:00
Max Bradbury 858a45f69d remove unused import 2020-04-19 08:14:26 +01:00
Max Bradbury 76e6c2477c test configurations 2020-04-19 08:13:55 +01:00
Max Bradbury dacccdc100 better example program 2020-04-19 07:34:11 +01:00
github-actions[bot] 1e0c129dca
Format Rust code using rustfmt 2020-04-18 17:08:16 +00:00
Max Bradbury f550c3696f handle errors for game 2020-04-18 18:07:25 +01:00
Max Bradbury 4f8c4e5195 Merge remote-tracking branch 'origin/master' 2020-04-18 17:48:42 +01:00
Max Bradbury 434e98cc60 implement error handling for game 2020-04-18 17:48:29 +01:00
github-actions[bot] 8983aa60d1
Format Rust code using rustfmt 2020-04-18 16:43:25 +00:00
Max Bradbury c47c4205aa implement error handling for avatar 2020-04-18 17:42:32 +01:00
github-actions[bot] cba6c16414
Format Rust code using rustfmt 2020-04-18 15:58:30 +00:00
Max Bradbury 074b51d5d9 fix failing error 2020-04-18 16:46:41 +01:00
Max Bradbury 8b05645c6b allow trailing spaces in dialogues 2020-04-18 16:32:50 +01:00
Max Bradbury 2e5d063371 more testing 2020-04-18 16:20:29 +01:00
Max Bradbury 0414fe757a optional room palette is now handled 2020-04-18 16:14:01 +01:00
Max Bradbury c954e56ea9 error handling for position 2020-04-18 16:12:06 +01:00
Max Bradbury 78b2319d4f implement optional palette id for room 2020-04-18 15:50:01 +01:00
Max Bradbury c441fce485 implement optional name for avatar 2020-04-18 15:49:33 +01:00
Max Bradbury 596be936d9 try to handle old "SET" rooms 2020-04-18 15:33:04 +01:00
Max Bradbury fe3fac5e2b handle old room format 2020-04-18 15:28:51 +01:00
Max Bradbury 7c76a9d3d2 go through more test data 2020-04-18 15:02:27 +01:00
Max Bradbury 9234ed1c63 test data 2020-04-18 14:48:25 +01:00
Max Bradbury e71c87ad4c handle room wall array 2020-04-18 14:39:17 +01:00
Max Bradbury 7c566ab9d3 update test results 2020-04-18 14:03:01 +01:00
Max Bradbury 2b8039d77d go through more test data 2020-04-18 13:40:37 +01:00
Max Bradbury e6845d7a39 fix avatar ordering 2020-04-18 13:38:41 +01:00
Max Bradbury e328661fbf avatar ordering fixed 2020-04-18 13:38:20 +01:00
Max Bradbury 96b956e0f2 fix font output 2020-04-18 13:37:26 +01:00
Max Bradbury cf8389ddd8 game version handling done 2020-04-18 12:49:51 +01:00
Max Bradbury 16e399b312 export font and text direction to string 2020-04-18 12:46:46 +01:00
Max Bradbury e1bf7cbae4 test RTL and font options 2020-04-18 12:45:43 +01:00
Max Bradbury 935075e7a1 redo version as a struct 2020-04-18 11:03:24 +01:00
Max Bradbury c8a4b4a8bc use room_format_line() 2020-04-18 10:48:14 +01:00
Max Bradbury c200957679 these are public functions, not for internal use 2020-04-18 10:46:33 +01:00
Max Bradbury c467489dd5 remove some unnecessary imports and call them inline 2020-04-18 10:46:07 +01:00
Max Bradbury cc0780b9cd implement font and text direction; call std and mock directly instead of importing 2020-04-18 10:45:01 +01:00
Max Bradbury c5604f2964 don't import mock, just reference directly 2020-04-18 10:26:42 +01:00
Max Bradbury f77c8b2d4e handle bitsy version as major and minor versions (uint); helper functions for game version/format 2020-04-17 09:37:03 +01:00
Max Bradbury 5413be82bc test framework for archive of bitsy game data 2020-04-14 00:41:05 +01:00
Max Bradbury 833e44a019 update mocks 2020-04-14 00:40:29 +01:00
Max Bradbury 88c4f36e31 make tile wall "optional" (specified or not); tile colour id 2020-04-14 00:40:14 +01:00
Max Bradbury b479275d7e room/position for sprite are actually optional! you can make a sprite and never place it anywhere;
colour id for sprite
2020-04-14 00:38:50 +01:00
Max Bradbury 389cfe5f10 error handling for position 2020-04-14 00:37:02 +01:00
Max Bradbury 5d1c515192 item colour id 2020-04-14 00:36:31 +01:00
Max Bradbury b4e05cdc1b trim whitespace around game data 2020-04-14 00:34:03 +01:00
Max Bradbury cc347dbf99 allow empty dialogues (needs fixing) 2020-04-14 00:32:24 +01:00
Max Bradbury a7c81f7f6c avatar.room -> room_id; add colour_id; game data line helper functions 2020-04-14 00:25:45 +01:00
Max Bradbury bfe679dfc8 move test resources 2020-04-14 00:17:40 +01:00
Max Bradbury 2ee08dd264 fix failing test for room 2020-04-13 19:26:11 +01:00
Max Bradbury df2d0105e6 dedupe optional line for tile 2020-04-13 19:25:49 +01:00
Max Bradbury 5d76798ace dedupe optional line for room 2020-04-13 19:14:57 +01:00
Max Bradbury 6dc9bbcc2d dedupe optional lines for item 2020-04-13 19:12:21 +01:00
Max Bradbury ba6d4e8b40 redundant comment 2020-04-13 19:11:51 +01:00
Max Bradbury b9dac0932f function for optional lines of game data 2020-04-13 19:08:21 +01:00
Max Bradbury 85f6501b2c tidy up game implementation 2020-04-13 18:01:42 +01:00
Max Bradbury 280e7e9cd6 function to safely add a tile 2020-04-13 17:44:51 +01:00
Max Bradbury e84fa4cc7c tile ID functions and tile mock 2020-04-13 16:19:59 +01:00
Max Bradbury 45ee94aae9 item id to u64; item.dialogue -> item.dialogue_id 2020-04-13 14:47:15 +01:00
Max Bradbury c7f1d7220c implement ToBase36 for u64; room id to u64; sprite id to u64; tile id to u64; sprite.dialogue -> sprite.dialogue_id 2020-04-13 14:43:23 +01:00
Max Bradbury f424c49301 convert exit room id to u64 2020-04-13 13:51:29 +01:00
Max Bradbury 53d5a28923 convert room id and palette id to u64 2020-04-13 13:46:33 +01:00
Max Bradbury e249727c3e allow Tile::from to be inlined 2020-04-13 13:30:55 +01:00
Max Bradbury 53204ba0f8 document room format 2020-04-13 13:30:26 +01:00
Max Bradbury 1928334b27 convert palette id to int 2020-04-13 13:30:08 +01:00
Max Bradbury 48e479c189 better warnings 2020-04-12 17:18:00 +01:00
Max Bradbury bef39f9b8b allow public uses of structs; add sample program 2020-04-12 17:13:08 +01:00
Max Bradbury fd4a682ade make Game struct public 2020-04-12 16:08:49 +01:00
Max Bradbury 8e5d55c2a5 implement scene transitions 2020-04-12 15:40:40 +01:00
Max Bradbury 9dfaaa0173 game module 2020-04-12 14:38:07 +01:00
Max Bradbury b1eb0160c7 room module 2020-04-12 14:28:11 +01:00
Max Bradbury 3d7bf1d24e variable module 2020-04-12 14:20:53 +01:00
Max Bradbury 02c3c3faae ending module 2020-04-12 13:52:36 +01:00
Max Bradbury 1426102e67 rename mocks to mock 2020-04-12 13:50:07 +01:00
Max Bradbury 6090d36559 exit module 2020-04-12 13:49:19 +01:00
Max Bradbury b887e178bb item module 2020-04-12 13:46:55 +01:00
Max Bradbury 82e2b77e2c tidy imports 2020-04-12 13:41:43 +01:00
Max Bradbury e0907d529f avatar module 2020-04-12 13:41:27 +01:00
Max Bradbury fa6300d798 sprite module 2020-04-12 13:35:17 +01:00
Max Bradbury 0faaf23a2d dialogue module 2020-04-12 13:26:33 +01:00
Max Bradbury ca1b86c2b3 rm leading whitespace 2020-04-12 13:22:56 +01:00
Max Bradbury 5d6e580918 position module 2020-04-12 13:21:27 +01:00
Max Bradbury a1782a6bed tile module 2020-04-12 12:53:11 +01:00
Max Bradbury a3bfdc68b1 image module; mocks module 2020-04-12 12:48:07 +01:00
Max Bradbury 92ab40e013 palette module; tidy up colour module 2020-04-12 12:35:39 +01:00
Max Bradbury e057b1f63a move colour to own module 2020-04-12 12:22:20 +01:00
Max Bradbury ffeb16363f this is a lib, not a standalone project 2020-04-12 12:01:42 +01:00
Max Bradbury cd82c075be implement From<String> 2020-04-12 11:51:30 +01:00
Max Bradbury b09b9dbece implement From for Colour 2020-04-12 11:31:18 +01:00
Max Bradbury 7b941b5d99 implement From for Tile 2020-04-12 11:29:13 +01:00
Max Bradbury 163fddda5a implement From for Image 2020-04-12 11:26:59 +01:00
Max Bradbury 2ec01ebfce re-implement _to_string functions as ToString 2020-04-12 11:22:14 +01:00
Max Bradbury 3d1beca268 implement ToString for Dialogue 2020-04-12 10:37:41 +01:00
Max Bradbury 4fd71f4a2c implement ToString for Image 2020-04-12 10:24:21 +01:00
Max Bradbury 57c9199bca one liner 2020-04-12 10:21:38 +01:00
Max Bradbury d3701348ec implement ToString for Position 2020-04-12 10:20:51 +01:00
Max Bradbury a58b0ae877 implement ToString for Palette 2020-04-12 10:15:51 +01:00
Max Bradbury 1221df2634 implement ToString for colour; test for palette to string 2020-04-12 10:06:08 +01:00
Max Bradbury aa8ac251f6 column width 2020-04-11 23:24:36 +01:00
Max Bradbury fb0fac0665 game to string function; example game function 2020-04-11 23:24:23 +01:00
Max Bradbury 2e4d9fd36e palette to string function 2020-04-11 23:05:47 +01:00
Max Bradbury 46458e2506 rename non-test "test" functions to "examples" 2020-04-11 23:04:56 +01:00
Max Bradbury e547cd341f fix this copy-paste job 2020-04-11 22:40:38 +01:00
Max Bradbury bea7a6aa4e game from string and related test 2020-04-11 22:40:26 +01:00
Max Bradbury 2e4114d4de tidyup 2020-04-11 18:24:43 +01:00
Max Bradbury 2f3ee8f302 use square root instead of constants 2020-04-11 18:24:22 +01:00
Max Bradbury f9140d8eb8 main function doesn't need to return anything 2020-04-11 18:18:46 +01:00
Max Bradbury 15eb501999 use ready-made function for splitting lines 2020-04-11 18:18:20 +01:00
Max Bradbury ee0ef8bbdf avatar functions, tests and test resources 2020-04-11 18:17:29 +01:00
Max Bradbury f73f55b581 move test resources into /test/resources 2020-04-11 16:07:53 +01:00
Max Bradbury 3e98f3acba fix sprite_to_string() 2020-04-10 16:52:53 +01:00
Max Bradbury eb7f33633f remove unused import 2020-04-10 16:42:38 +01:00
Max Bradbury a7d9354d9d room to string 2020-04-10 16:27:23 +01:00
Max Bradbury 0ebe3babe6 room to string; dedupe test resources 2020-04-09 08:28:08 +01:00
Max Bradbury c00f9aefcf Game can be Bitsy HD 2020-04-08 07:40:16 +01:00
Max Bradbury ed33ff3972 room from string (wow what a monstrosity) 2020-04-06 23:24:10 +01:00
Max Bradbury 9830d57d13 handle room tiles 2020-04-06 20:41:33 +01:00
Max Bradbury 6e9b91d845 handle room endings 2020-04-06 20:35:01 +01:00
Max Bradbury d25f7c1026 remove unused import 2020-04-06 20:34:47 +01:00
Max Bradbury 753e1142c0 a room's endings is actually a hashmap of ending IDs, not whole endings 2020-04-06 20:34:35 +01:00
Max Bradbury 11a04fb18f variable functions 2020-04-06 19:11:41 +01:00
Max Bradbury 82a7bc0763 dialogue functions 2020-04-06 17:18:17 +01:00
Max Bradbury 8b383bc982 fix items map 2020-04-06 14:24:35 +01:00
Max Bradbury b0defa6f73 handle items 2020-04-06 14:23:37 +01:00
Max Bradbury ac692d05a3 variables 2020-04-06 14:22:35 +01:00
Max Bradbury 19f01e05d8 handle exits 2020-04-06 14:21:58 +01:00
Max Bradbury b9fecbe8fa ending functions 2020-04-06 14:11:56 +01:00
Max Bradbury e86625bbc8 exit functions; ending and room stub functions 2020-04-06 13:21:59 +01:00
Max Bradbury 95d7e26cf1 I think room_format is either 0 or 1 but could be 2+ in the future 2020-04-06 12:27:58 +01:00
Max Bradbury 95cb1d6039 take room out of position struct as they're really separate 2020-04-06 12:27:29 +01:00
Max Bradbury c38d369725 rearrange 2020-04-06 12:26:26 +01:00
Max Bradbury ad43f73027 item to string; dedupe 2020-04-06 09:02:52 +01:00
Max Bradbury 5f531d9d1d item from string 2020-04-06 08:54:43 +01:00
Max Bradbury 82779a3ed5 fix image_to_string 2020-04-06 08:36:52 +01:00
Max Bradbury 4bfb82dba0 fix test images and add test sprite 2020-04-06 08:27:08 +01:00
Max Bradbury 2d2abcdd56 dedupe test images 2020-04-06 07:55:10 +01:00
Max Bradbury 7f6fa9df82 animation frames to string; sprite to string 2020-04-06 07:23:20 +01:00
Max Bradbury 6d8f8fa9b4 sprite from string 2020-04-05 23:58:10 +01:00
Max Bradbury 894889afa7 update todo 2020-04-05 23:03:18 +01:00
Max Bradbury 9e7dffa516 use built-in debug macros 2020-04-05 23:02:03 +01:00
Max Bradbury 47a9259526 functions for positions 2020-04-05 23:00:15 +01:00
Max Bradbury ebd35b3297 missing tiles 2020-04-05 22:33:06 +01:00
Max Bradbury 645d89d05d consistent function ordering 2020-04-05 22:28:35 +01:00
Max Bradbury f27f31fac8 switch pixels to uints 2020-04-05 22:28:23 +01:00