0385366fce
use player jumping sprites when player drops below platform
Humza Shahid2025-02-24 12:59:59 +00:00
b697eaf8e0
add sprites for when player jumps while facing left, and add code to handle this case
Humza Shahid2025-02-24 12:43:08 +00:00
ee5b30da0e
make characters bigger in level (still a multiple of 16 though so will scale nicely)
Humza Shahid2025-02-24 11:31:43 +00:00
0353c47f27
add jumping/falling sprites when player is facing right (todo: add sprites mirrored to face left)
Humza Shahid2025-02-23 13:47:41 +00:00
d056e08ce7
add ternary string set file, and code an insert function for it (plus datatype definitions, etc.)
Humza Shahid2025-02-23 10:44:39 +00:00
4c853c1843
add animation for player walking leftwards
Humza Shahid2025-02-23 07:43:23 +00:00
cc01ee7ec9
remove player-walk-right-10 and player-walk-right-11 from walk cycle animation (looks better without those frames)
Humza Shahid2025-02-23 07:30:44 +00:00
9286c26231
add a couple of frames to walk animation, and change colour of walls back from white to black (changed to white temporarily so we can see walk animation isolated from any other objects)
Humza Shahid2025-02-22 19:22:48 +00:00
bd49877cf7
add code for going through right-walk cycle in draw/vector code (for player)
Humza Shahid2025-02-22 19:02:28 +00:00
4a41976009
add 'animTimer' to player type, to help decide which frame to show for player
Humza Shahid2025-02-22 14:00:33 +00:00
bf40a2b6e6
create assets for player walking rightwards (but they are not implemented in code yet)
Humza Shahid2025-02-22 13:44:01 +00:00
f8ed79c81f
small improvement to player's sprite (and create subdirectory for player's sprites too, as I expect there will be quite a few)
Humza Shahid2025-02-22 06:02:28 +00:00
defaf6c820
add functionality for cancel button in options-update.sml
Humza Shahid2025-02-22 05:16:17 +00:00
e9f52d5cda
allow cycling in options menu (when pressing down while on bottom button, it goes back to the top button, and whenh pressing up on the top button, it goes to the bottom button)
Humza Shahid2025-02-22 05:07:20 +00:00
86aea3a147
trigger confirmation in title-update.sml only when attack is newly pressed (not when attack is held)
Humza Shahid2025-02-22 04:53:51 +00:00
1bab4d89d7
done with saving updated keybindings, both saving to application's RAM memory and to disk
Humza Shahid2025-02-21 20:31:26 +00:00
edb9b300c3
add function to convert CoreKey.key_code to string, as preparation for converting user key record to string, which itself is a prerequisite of saving controls configuration to file
Humza Shahid2025-02-21 19:14:58 +00:00
e6b0a5f37f
add 'saveKeys' boolean to GameType.game_type, which should tell us to assign the new userKeys record to the InputState (which is implemented), and should also tell us to convert the keys to a string and save it to controls.config
Humza Shahid2025-02-21 18:32:48 +00:00
e1fb4004dd
add 'tempKeys' field to OptionsType.options_type, so that any key binding changes in the menu do not take immediate effect (requires pressing 'save button' in order for changes to be saved and take effect)
Humza Shahid2025-02-21 18:18:39 +00:00
abcbc030e1
highlight different options in red when they are (focused andalso selected)
Humza Shahid2025-02-21 14:53:26 +00:00
b2f58f1c9a
record and act on selected keys in options (except for save button and cancel button which are not acted upon)
Humza Shahid2025-02-21 14:46:54 +00:00
20338996b8
add back files with annotations to mlb (took them out before because smlfmt can't parse vector expressions, and also can't parse mlton's ffi syntax)
Humza Shahid2025-02-21 13:37:41 +00:00
40fff7729f
add 'newKeys' field (list of key codes pressed in frame) to frame input type, so we can change key bindings at runtime later
Humza Shahid2025-02-21 11:57:29 +00:00
568b21343b
add function which will allow placing text on centre of screen
Humza Shahid2025-02-19 19:59:05 +00:00
bd145e6b74
make sure that drawn text is scaled + centered to middle of screen, if window size doesn't match expected ratio of 16:9
Humza Shahid2025-02-19 05:37:04 +00:00
dab81e3904
begin function for drawing title screen
Humza Shahid2025-02-19 04:07:27 +00:00
6ca2d379f7
bring in cozette-sml so we can draw text
Humza Shahid2025-02-19 03:48:38 +00:00
25b2c41355
begin title screen by adding title screen type
Humza Shahid2025-02-19 03:39:36 +00:00
6b4b637624
done adding LevelType.level_type as a field of GameType.game_type, and having main loop go through GameUpdate.game_type -> LevelUpdate.update
Humza Shahid2025-02-18 13:48:17 +00:00
afe878c05d
begin parameterising level so that it fits into larger type (with different modes like TITLE, LEVEL, SETTINGS, etc.)
Humza Shahid2025-02-18 13:16:52 +00:00
b426ddbdd1
adjustment to player sprite, allowing the inside of the sprite to be a chosen colour
Humza Shahid2025-02-18 12:48:55 +00:00
d3200745d0
allow player to have a different width/height that is not a perfect square, (now we have Constants.playerWidth and Constants.playerHeight, having deleted the previous size in Constants.playerSize)
Humza Shahid2025-02-18 12:31:22 +00:00
78905b59f0
allow width and height to have a different number of click points
Humza Shahid2025-02-18 11:53:28 +00:00
e62493ce56
change size of player/enemy from 35 to 32 (even number means we can resize better)
Humza Shahid2025-02-18 11:09:07 +00:00
6d028214d5
when game is first loaded, assign parsed controls (or at least default controls) to imperative shell's state
Humza Shahid2025-02-17 03:53:04 +00:00
18495a0cca
successfully parse controls from file (but todo: save controls imperative shell on load)
Humza Shahid2025-02-17 03:48:31 +00:00
99669dd0b6
add function to convert string to CoreKey.key_code (for parsing/loading controls from files)
Humza Shahid2025-02-17 01:39:41 +00:00
291ee2f7f2
differentiate 'upHeld' from 'jumpHeld' (we may want a different button for going up/down menu and a different button for jumping)
Humza Shahid2025-02-16 13:51:52 +00:00
0df453f9c9
partially done coding key remapping functionality (what works: GLFW key code -> CoreKey.key_code, acting on CoreKey.key_code every frame; todo: load from config file on start up, have screen where we can remap keys, and save to config while when key mappings are changed)
Humza Shahid2025-02-16 13:45:14 +00:00
f2f1eeab8e
additional scaffolding of user's key mappings in imperative shell
Humza Shahid2025-02-16 13:17:14 +00:00
47bda26da5
begin coding functionality for remapping keys
Humza Shahid2025-02-16 12:45:29 +00:00
190f11d7ef
different colours for different enemies so they are easier to differentiate
Humza Shahid2025-02-15 12:18:08 +00:00
491ad11c4c
remove a bit of dead code from fcore/projectile.sml
Humza Shahid2025-02-15 08:18:57 +00:00
e538caa6c6
add 'facing' field to enemy, and update that field when enemy starts moving in different direction (with regards to x_axis)
Humza Shahid2025-02-15 08:13:36 +00:00
0b9bdeceff
update positions of falling enemies per frame (and filter them out too)
Humza Shahid2025-02-15 02:17:01 +00:00
219b37053b
add functionality for falling enemies to turn into player projectiles when attacked
Humza Shahid2025-02-15 02:02:48 +00:00
b8934e3add
add function to generate quad tree from falling enemies
Humza Shahid2025-02-15 01:52:19 +00:00
e758a5a13c
refactor falling_enemy to be contained in FallingEnemyMap, instead of a plain vector
Humza Shahid2025-02-15 01:42:29 +00:00
5412a71d30
add code to make enemy fall when attacked by projectile (assuming health is enough)
Humza Shahid2025-02-14 18:18:46 +00:00
c75e7bc33b
add attacked enemies who are defeated to player's list of defeated_enemies, allowing them to be shot as projectiles
Humza Shahid2025-02-14 13:15:45 +00:00
74a3fef32a
receive latest version of GapMap, which fixes a bug to do with removing an element
Humza Shahid2025-02-14 13:04:30 +00:00
e2da10e908
amend 'removeMiddle' function in gap_map.sml: before, we were leaving element we want to remove in rkhd/rvhd because we started the slice at 'insPos', but now we increment 'insPos' by 1 so we filter that desired element out
Humza Shahid2025-02-14 13:02:42 +00:00
b239dfa04d
add functionality to have enemies tract to player's attack
Humza Shahid2025-02-14 12:59:22 +00:00
50b57b9ef9
a little refactoring (Player.runPhysicsAndInput function now does just that, instead of also checking for collisions with enemy)
Humza Shahid2025-02-14 11:19:24 +00:00
e00db5d8a3
make enemies move per loop (calling update EnemyMap by calling EnemyBehaviour)
Humza Shahid2025-02-14 10:43:27 +00:00
46a1836ae2
additional refactoring, moving player type into its own directory
Humza Shahid2025-02-14 10:13:03 +00:00
d1e23b5455
refactor platform and wall type declarations out into platform.sml and wall.sml
Humza Shahid2025-02-14 09:26:07 +00:00
93aebe5fa1
a bit of refactoring with regards to enemy's structures and files
Humza Shahid2025-02-14 09:06:32 +00:00
9749abf1d5
add 'env' parameter to mapper in gap_map.sml
Humza Shahid2025-02-13 11:56:12 +00:00
f1521acec1
refactor file order in preparation for adding GapMap for enemy
Humza Shahid2025-02-13 11:24:44 +00:00
d23396f5d1
cover exhaustive case reported in gap_map.sml (in 'joinSlices' function), and make it possible to map over values by using a functor
Humza Shahid2025-02-13 10:52:55 +00:00
ae3238eabe
minor adjustments to gap_vector.sml to make functor fit GAP_VECTOR signature
Humza Shahid2025-02-13 08:26:48 +00:00
cfce329255
add gap_vector.sml, which is just the same as gap_buffer.sml, except generic through the use of functors
Humza Shahid2025-02-13 08:22:55 +00:00
33678f2b0d
code 'remove' function for gap_map.sml, completing the functionality I need for GapMap (but warning that, although most functions were edited from gap_set.sml, gap_map.sml is entirely untested)
Humza Shahid2025-02-13 03:21:18 +00:00
2c187d0e87
implement 'moveTo' function for gap_map.sml
Humza Shahid2025-02-13 02:41:29 +00:00
d3cca23549
implement 'moveToStart' and 'moveToEnd' functions in gap_map.sml
Humza Shahid2025-02-12 13:59:27 +00:00
18bd71d608
fix compile errors regarding 'add' function in gap_map.sml (error was that 'joinSlices' helper function returned 'rightVals = rightKeys' instead of 'rightVals = rightVals')
Humza Shahid2025-02-12 13:44:34 +00:00
2e03ae9828
add 'min' and 'max' functions to gap_map.sml
Humza Shahid2025-02-12 12:45:45 +00:00
55d20a2b82
done with adding/inserting into GapMap
Humza Shahid2025-02-12 12:25:35 +00:00
206df031b3
implement 'insRight' function for inserting to the right
Humza Shahid2025-02-12 12:25:08 +00:00
0b8b47312a
implement 'insRight' function for inserting to the right
Humza Shahid2025-02-12 12:12:27 +00:00
ca3e357fde
code 'insLeft' function for gap_map.sml
Humza Shahid2025-02-12 11:08:05 +00:00
2048c04179
progress implementing 'add' in gap_map.sml
Humza Shahid2025-02-12 10:15:36 +00:00
4c8b404c09
add code so that bat also moves vertically (in addition to previous horizontal movement) when updating enemy state
Humza Shahid2025-02-12 00:25:55 +00:00
1dc3116b77
add fields to enemy which are relevant to bat's state
Humza Shahid2025-02-11 23:54:13 +00:00