(Robby Learns Math) my new puzzle game | devlog
hello everyone! hope u are gaving great days as i pubished my new puzzle game: Robby Learns Math, in Robby Learns Math (i will shorten to RLM), the player controls robby, a small robot that has to venture into a land of math, were munbers and signs can be pushed around like boxes, robby can join two munbers and a sign and get the operation's result (e.g.1+1 -> 2), munbers are need to progress as lock blocks that need a munber to be unlocked (e.g. a 2 lock needs a 2), here i will show some things about my game which I find very interesting.
equations rules
the equations for the munbers and signs were very convoluted due to the fact that puzzle script cant do math or store data as variables, so the only fix i can think of is to write every single case as puzzlescript rules:
(equations) (plus equations) late [Onebox | Plus | Onebox] -> [|Twobox|] sfx0 late [Twobox | Plus | Onebox] -> [|Threebox|] sfx0 late [Onebox | Plus | Twobox] -> [|Threebox|] sfx0 (minus equations) late [Zerobox | Minus |Zerobox] -> [|Zerobox|] sfx0 late [Zerobox | Minus |Onebox] -> [Minus|Onebox|] sfx0 late [Zerobox | Minus |Twobox] -> [Minus|Twobox|] sfx0 late [Zerobox | Minus |Threebox] -> [Minus|Threebox|] sfx0 late [Onebox | Minus | Onebox] -> [|Zerobox|] sfx0 late [Twobox | Minus | Onebox] -> [Minus|Onebox|] sfx0 late [Onebox | Minus | Twobox] -> [Minus|Onebox|] sfx0 late [Threebox | Minus | Twobox] -> [Minus|Onebox|] sfx0 late [Twobox | Minus | Threebox] -> [Minus|Onebox|] sfx0 late [Threebox | Minus | Onebox] -> [Minus|Twobox|] sfx0 late [Onebox | Minus | Threebox] -> [Minus|Twobox|] sfx0
this works, but sometimes errors due to human mistakes can happen, and in this chunk of code, its very hard to see mistakes until you closely look at it for errors, and you can miss out on some equations (like 0+0 in the code), but if you dont find a case were its possble to make one of this missing equations, its fine, this coments helped me a ton on making new signs. I will probably change game engines to solve this problem.
lock blocks
lock blocks i also quite like! they are much smipler to the equations, and they look nice also:
(unlock lock blocks) [> Zerobox | Zerolock] -> [|] sfx2 [> Onebox | Onelock] -> [|] sfx2 [> Twobox | Twolock] -> [|] sfx2 [> Threebox | Threelock] -> [|] sfx2 (error if munber does not match) [> not1box | Onelock] -> [ not1box | Onelock] sfx1 [> not2box | Twolock] -> [ not2box | Twolock] sfx1 [> not3box | Threelock] -> [ not3box | Threelock] sfx1 [> not0box | Zerolock] -> [ not0box | Zerolock] sfx1
its simple: if a munber box runs into a lock of same value, delete both and play 'sfx2', if its not of same value, do nothing and play 'sfx1', this 'NotXbox' are object legend groups for objects that are not of munber box of value x:
Box = Zerobox or Onebox or Twobox or Threebox or Plus or Minus Obstacle = Wall or Onelock or Twolock or Threelock or Zerolock not1box = Twobox or Threebox or Zerobox or plus or Minus not2box = Onebox or Threebox or Zerobox or plus or Minus not3box = Onebox or Twobox or Zerobox or plus or Minus not0box = Onebox or Twobox or Threebox or plus or Minus
here, 'Box' means a object that can be pushed around by the player or other box objects, but cant move to a Boxblocker object (i will talk about this object later), 'Obstacle' means a object that the player cant move to (aka a wall), and here we find the 'NotXbox' groups, you see that each of the groups has every box object, expect for one, that depends on what this group excludes (e.g. 'not3box' has all signs and munbers, except munber 3 box, due its 'not3box'), this made the lock logic much more simple, since i dont have to check each case of munber v. lockblock, since noew they are handled automatically, saving me lots of troubles.
extras
i dont have much to talk anymore but here are a few extra things i want to show! frist is the rest of the rules:
[> Player | box] -> [> Player | > box] [> Player | Boxblocker] -> [> Player | Boxblocker] [> box | box] -> [> box | > box] [> Player | Flag] -> checkpoint sfx3 message checkpoint set! [> box | Flag] -> [ box | Flag] [> Player | Obstacle] -> [Player | Obstacle] [> box | Wall] -> [box | Wall] [> box | Boxblocker] -> [box | Boxblocker] sfx1
as you may guest, this are general rules for everything in the game (player can push boxes and not move into obstacles, boxes cant move into boxblockers, flags set checkpoints, etc)
here is the collison layers:
================ COLLISIONLAYERS ================ Background Boxblocker, Flag, End Player, box, Obstacle
as you can see, boxblockers, flags, and the 'end' object (use to trigger the ending) are one layer below the rest of the objects, this is so the player can move into boxblockers also! since objects of the same layer cant overlap each other (and yes, i forgot about this while making the obstacles 💀) .
next up this the legend (i will exclude the legend groups as i talked about them earlier):
@ = Player + = Plus - = Minus 0 = Zerobox 1 = Onebox 2 = Twobox 3 = Threebox ' = Zerolock a = Onelock b = Twolock c = Threelock # = Wall F = Flag , = Boxblocker ! = End
nothing to say about the legend, just your averge puzzlescript legend, but this is so i can show you one more thing...
THE GAME MAP
,,,######################............... ,......###...#....###,,,#............... #......###.2.#.#...1...,#............... #.,,...###...#.+..####+##............... 1.1#...####c##.#...1..1##............... 2.1#...####............##............... 3.1#...####...f###,,,,,##............... #.f#.#############............... #a#,,#.##################........ ,....#.##.1.1..######..#########........ ,.#.-1.a#..........1...#########........ #.#.-1.,#,,,,,,##.###..##...####........ #.#,,#.##..+.........1.b..+.####........ #......##f.....######..#########........ ,3...#########.#################........ ,,,#.f########.#################........ ####a############################ #,,,.,###..###1#####...################# #,,.-1###..###.#####.+.##########..##### #,,.,,###..###.##@...1###########..+1..# #,,',,####.+.1.####....b...f...........# #,..-1###,.,##.######1############1##### #,,.,,,##,.....,################# #1-..,,##,,.#,,,##################.##### #,,,..,####.######################.##### #,,...,###..a####..............###.##### #,1.,.,###.....................###.##### #,,,,.,##########.....f............##### #,,,,.,##########..............######### #,1...,#........b..............######### #f,.,,,#..b######..............######### ###.#####.########'##################### ###'#####.######..!..................... ###1#####.######.#..#................... ###.#####.######........................ #.........######........................ #.....##..######.#..#................... #.1.-.##########..##.................... #.....##########........................ ################........................
sadly in ascii it got destroyed due to the font style of this code format, but here is the map but in the editor:
what a chonky guy! you can see that the map does not use the top-right and the bottom-right corners. this is due to puzzlescript levels need to be rectangular, also the map had a lot of changes to be what it is now!
this is more or less what i want talk about, so hey if you enjoyed the game, thank you very much! <3
- tomato (my alias)
Files
Robby Learns Math
a block pusher, with math
Status | In development |
Author | jose014384 |
Genre | Puzzle |
Tags | Math, PuzzleScript |
Leave a comment
Log in with itch.io to leave a comment.