Legally distinct platformer maker banner

Legally distinct platformer maker

25 devlogs
24h 52m 48s

A mario maker style game that is legally distinct :mind-blown:
Built with raylib and c with a handmade 8x8 charm!

This project uses AI

Used ai for the html of the website so it is centered to the screen, as well as one problem i couldn’t fix for the physics engine

Demo Repository

Loading README...

nmsoukmandjiev007

Added tooltips!
This was mainly me wrestling with the raylib text api because i hate it with a passion, but at least it’s a lot easier than making a full blown text engine.
There isnt really much to say on the surface as it’s literally just a thing that displays whenever you hover over a block.

The real issues came with…. it somehow shitting up the player code!!!!!!!!!!!!!!
I genuinely have 0 clue as to why it would happen, as they do not share anything aside from one completely irrelevant function, causing the drawing code to be somehow broken. I fixed that by removing the include, and also removed the use of null in the editor because im like 3% sure that did something. It also broke physics somehow yay

Thats done and dusted though, and in the end it does look very nice! A bit big, but ill add a toggle for keeping them on or off

Attachment
0
nmsoukmandjiev007

I have started on applying feedback for the editor!

This current edition wasn’t exactly specified, but a voter didnt know what to do and that no information was provided, so i added a feature where the editor highlights a transparent preview of the block that has been selected, so there is an obvious visual cue that you have to click the block, instead of the old blue border :)

I also made it work for the rectangle mode, which was quite simple since i already initially calculated the top left and bottom right coordinates, making it a simple loop that draws over each tile that is in the area of the rectangle.

I’m now working on having shortcuts being displayed on the toolbar!

Attachment
0
nmsoukmandjiev007

I optimised the renderer and started working on the editor!
Before the game used to render the whole grid every frame, which is quite expensive, especially if i want to scale the project.
Now i implemented a way to only render what is being shown on screen, drastically reducing the performance from 15000 iterations to just 2000 :)
I also made the tile coordinate conversion more optimised by making it an inline functions (each function call gets replaced by whats actually in the function during compile time), and using a bit shift for faster division. The bit shift also makes the function more reliable too! Im also planning to change all multiplications/divisions to bit shifts, but that may be excessive and make the code a bit unreadable, so il only use them for what matters most!

Heres a little visual diagram that shows how it helps

Attachment
0
nmsoukmandjiev007

This took so damn long….
So you know the issue where the player sorta bounced around after jumping… well i genuinely had no clue what was going on.
I kept changing and testing and changing and testing for AN HOUR…. and it still wasnt fixed. The amount of tracelogs i had at once was criminal
Because of that i decided to see if claude can fix it…. not even a minute later “Oh! Its because you dont stop applying gravity when the player is grounded. I also changed the camera lerp to work alongside the changes just because :)”.
I give up man…
Anyways, it works! Shame that i didnt manage to fix it myself, but sometimes its not worth banging your head against a wall for another hour, especially since i havent started applying all the feedback from the voters regarding the editor.
Im also working on optimising the code a bit more for the sidequest!

0
nmsoukmandjiev007

This devlog was mainly to address feedback from the voters!
Firstly, people mentioned that friction didnt apply as greatly when moving left, so i changed the friction from it being multiplicative (*0.93) to the speed every frame to it being subracting or addind (+ or - 0.5 to the players current speed every frame)
This already made the game feel miles better since you dont get flung off the map when trying to stop moving left.

Many people were also saying that my player’s movement speed was wayy too fast, so i halved it :). The voters were right, since it made the feel of the game much more controllable, and therefore more enjoyable.

Someone also mentioned that moving left or right whilst jumping was buggy, but i couldnt reproduce any type of problem, so i checked that off of my todo list.

I also updated the input system for easier direction change, and for the better friction. It feels a bit more responsive, but nothing too crazy.

I very stupidly had my player x and y as ints, so that caused a bug where the right movement was half as fast compared to left (no clue why, probably some math stuff), so there is that.

Also added a layer of spikes at the bottom of the map so the player dies when he falls off

There is also an issue with jumping due to the new code, but i will fix that soon!

Those were mainly all the issues with the player, so i will now move on to the feedback of the editor once everything is fully polished.

The recording is the issue i was talking about, probably rounding/truncation error that confuses where the player should be by 1 pixel

0
AVD

Tagged your project as well cooked!

🔥 AVD marked your project as well cooked! As a prize for your nicely cooked project, look out for a bonus prize in the mail :)

nmsoukmandjiev007

Oopsie, some bugs were still left when i shipped.
Anyways, those were all those were all fixed.
For those curious, the issues were:
Pressing play in the editor would cause blocks to be placed behind it
Hedgehog did not move left or right
And a feature for wasd input

NOW its time to ship :)
Cute level i made too!

Attachment
0
nmsoukmandjiev007

Shipped this project!

Hours: 18.88
Cookies: 🍪 566
Multiplier: 24.98 cookies/hr

I made an 8x8 mario maker inspired clone in C. It required me to build my own physics, collision and enemy engine, and it was a really interesting way to learn how platformers are made. It also features an editor with it’s own tiling engine that has 8 blocks and one enemy currently, as well as shortcuts to make level creation streamlined.

This project taught me how to write modular code for things like blocks, and it helped me understand new concepts of c i havent used before such as function pointers. This was really fun to make too, and i cant wait to continue working on it!

nmsoukmandjiev007

first week of lock in DONE
its 1am right now and i just spent the last 3 hours wrestling emscriptem
anyways, it finally works and you can try it out here https://nikoi008.github.io/Legally-distinct-platformer-maker/
Changelog because i am too exhausted to devlog

Changelog

Attachment
Attachment
0
nmsoukmandjiev007

Updated the readme!
It’s just a little summary of the game, as well as an explanation to every shortcut and block that is in the game (istg someone is still gonna say “idk how to use it” in the votes)
I should probably also add a player controls section but i hope arrow keys or wasd + space is intuitive enough

Todo before first ship
Menu
Animation
Better editor gui
Emscriptem for web build <–– this thing sucks so much btw

Attachment
0
nmsoukmandjiev007

Enemy ai has been added!!!! Its a hedgehog style goomba enemy that is invincible for now
It was quite simple to do, but that’s mainly because everything is coded for just one enemy. Itll probably rack up in techincal debt further into the project, but thats a problem for future me :’). The good thing is the code can be reused if i make a koopa style enemy because its literally a goomba that doesnt want to fall off.
Also good news is that the code is quite fast. Its O(n), so it wont cause any problems even with high amounts of enemies.
Currently its still quite basic though, since it disappears after you start the level, and it doesnt actually mirror left and right towards the direction it’s facing.
Todo before end of lock in!
Better gui for editor
Player and hedgehog animation
Readme
Web build

H E D G E H O G

Attachment
0
nmsoukmandjiev007

100 hours total!!!
This devlog was mainly just seperating everything into headers and c files so the code is more organised. It’s done but there are still some bugs i need to address before it’s fully finished. I also added a little easter egg in enemy.c because i have not continued with the ai just yet.
Aside from that, i have organised the sprites and audio to be in their own seperate folders so it isnt as cluttered.
A bit of bug fixes and improvements here and there, but nothing too crazy worth mentioning.
Todo!
Change the sprite paths so that people actually see things
enemy ai
improved gui for editor
web build!
improved readme

Attachment
0
nmsoukmandjiev007

Again, not a crazy devlog, but some good features, and im starting something really special!
I added a nice scrolling background at the start. the pallete is subject to change, but its nice for now!
Aside from that, i have started on working on enemy code. it’s going to be goomba style ai, but its going to be a fun challenge, as i want to make it as efficient as possible with an “infinite” amount you can have on screen (technically 14998, because of the grid size and the 2 necessary flag tiles that need to be placed).

todo!
docs
animated character
actual menu
improved editor (not being able to place blocks on gray bar below, ability to use rectangle mode and move camera from bottom there too)

0
nmsoukmandjiev007

This devlog isnt really much tbh, but it did add some nice additions and fixes.
Firstly i added coins! Theyre purely visual but they do increase an internal counter, and it’s got sound effects!
Aside from that, i updated how collision works with non-solid objects that have a trigger attached to them, also making them bounding box coliisions.

i PROMISE ill get tooltips done

Attachment
0
nmsoukmandjiev007

I am really glad i spent the time perfecting this.
So i redid the collision system to be bounding box collision through loosely watching a tutorial. Its honestly miles better than my jank, snap to tile collision that i tried doing myself. This also meant that i had to revamp parts of the physics engine to make it work, but it all went smoothly.
I also added coyote time, so now even if you jump a few frames after leaving a block, the jump still registers.
The video shows both the new collision and coyote time in action.

new todo!
Tooltips (genuinely ill never finish them)
enemie
docs
animated character
menu

0
nmsoukmandjiev007

Added cycle blocks, and to be honest, this is the coolest addition i have added so far!

It was quite painful to program, as i didnt want to make it really inneficient by checking all 15000 possible tiles you can place it on. This meant that i had to change parts of the collision, drawing and tile placing engine for it all to work together. However, the final result is pretty much perfect and very much efficient!
In the end, this was super worth it because it makes the game so much more lively and is just a very useful tool for making cycle heavy levels (which i despise in every single platformer, but i’ll settle my differences for now)

I promise ill get the tooltips done soon sob-ios
Heres a recording of the progress so far - pretty buggy falling logic so ill have to get that fixed, and also skill issue on my part. The sidescrolling camera is working amazingly though which im happy about

0
nmsoukmandjiev007

Spikes added! they were a quite easy feature to implement, so nothing too much to say about that. I just added them in and made it so that they call a function to get you back to the start of the level when touched.

Ill probably start working on tooltips and more shortcut stuf so people actually know what theyre doing… the issue is raylib’s text engine is genuine doggy poo poo when it comes to scaling so maybe i make my own text engine!???! Ill probably just slap on pngs of the tooltips and call it a day tbh

Attachment
0
nmsoukmandjiev007

I just made the end goal work, but first let me tell you about my little revelation in C just now.
As i was working on the endgoal, i wondered if i could sort of “hook” a function for when the plaer collides with the flag, it would call a function that produces a win screen. of course i could just use if statements but that’s not really scalable
So i searched online for something like that, and what i found was truly beautiful: function pointers.
All i had to do was take in a function pointer in my struct, create a function that handles the callision and calls the function in the struct, and voila.
Its just amazing and i really enjoyed learning this because it is SO useful. Its also really fun cominng across new concepts when learning a language!

Anyways all that out of the way, the end goal works!. Its just a flag but checkered, though i have an idea on how to distinguish it from the other flag
Todo!
Spikes
Tooltips for ui objects
helper guide for shorcuts (might just be combined with tooltipes)

Attachment
0
nmsoukmandjiev007

It fills!! Nothing much to say about this lol, but as you can see in the video, it fills and works perfectly.
I honestly thought it would be a bit harder to implement. While it was still challenging in the first place, i mainly had to wrap my head around on how it works!.
Now the todo list is
Some sort of damaging thingy
An end goal
A little helper guide for shortcuts and more things in the UI

Its geninely so fun seeing this get better and better the more i work on it!! I might draw the cover art rn!!

0
nmsoukmandjiev007

Got started on a rectangle fill type thing, so far it works pefectly visually, though i havent actually implemented block fills, but it looks cool so im taking that. I also learned of the fade function in raylib which makes a transparent colour, so that added a bit of pizzazz to the tool.
Its currently only accesibe via the “r” shortcut so i gotta add it to the little board so its a bit more accessible.
Ill update y’all once that’s done!

Attachment
0
nmsoukmandjiev007

Left and right collision is now perfectly implemented! Right collision was really easy, but i forgot that the sprites x position is 0 pixels left when checking for left collision, so that confused me for a while.
The came upwards collision… This was so annoying to program, and even when i managed, it works terribly with snapping to the top tile and just not very good behaviour. Ill try to fix it later but i wanna finsh up the core parts of the editor.

New todo!
Make collision better
Animation
End goal
Line tool!
And maybe a menu :’)
Its going well so far though, but i probably need to check a tutorial of sorts or maybe redo the collision

0
nmsoukmandjiev007

Added some friction which already made the movement so much better, and i am currently implementing the collision system. Which i managed to do, except the second she collides onto something, she just kinda stays there, unable to move, yet able to jump….
I dont know how to fix that but i dont wanna watch a tutorial just yet, so ill continue working on it.

Todo-
Fixed collision
Character animation while walking
End goal
All the editor todo i still havent done

0
nmsoukmandjiev007

Hackatime was down :’)
Anyways, I am halfway done with the player engine, as i have implemented gravity, jumping, collision only on feet, and acceleration but no friction. Theyre all working perfectly, but i need to find the right numbers cuz moving the character around feels unsatisfying. Other than that, slight changes were made to the editor such as adding a warning if you didn’t place a flag object, which is the start indicator of the level.

Now the todo list is:
Actual collision from top and sides
Friction
Animation

And for the level maker
Enemies of some sort
Autotiling
End goal
And a few more blocks
Also a more robust way to move in and out and zoom in and out because it tweaks out when you go too far

Attachment
0
nmsoukmandjiev007

Did a little bit of work with the player and integrated it with the editor.
Firstly, i designed a little 8x8 player sprite since 8x8 is cute and thats the resolution ill be working with for this project.
Secondly i made it it so that the player’s start position is linked to the flag so he start from the flag. It was a quite simple thing to do but very satisfying at the same time.
I also made basic input handling, but as you see, no collision yet.

Todo:
Everything i said before
Collision
Gravity

0
nmsoukmandjiev007

Worked a little bit more on the editor, added a flag object which can only be placed once and is how you start the level.
I did have to change how blocks were being placed, but at least there is now an identifier for each block that says whether it can only be placed once

Got started on the platformer code too
todo list right now is quite large, but its
Add an end goal
Make some sort of a physics and collision engine for the player
Autotile ground blocks so they look nicer
Enemies with an easy way of showing how far they go
Web build :0

and other things probably but i shouldnt get ahead of myself

0
nmsoukmandjiev007

Added the ability to change tiles from the bottom screen, and it works like a charm. Since the primitives of the tile engine are almost done, ill polish it and then start working on the menu and platformer engine.

Im really excited to get this all working and polished so i can move on to the platforming engine

0
nmsoukmandjiev007

Got started on the level editor. So far the primitive features such as dragging, panning placing and deleting work, and im now getting started on being able to select differnt blocks, as well as maybe autotiling for ground sprites (really excited to implement this).

Current controls are left click to place/ delete blocks, scroll wheel to zoom in/out and shift+left to drag

0