1 free read left. Create a free account for unlimited reading + AI research.
Create free accountthis is a full game and it plays like this in this video i'm gonna try to make games with just 10 lines of code that's not a lot challenge accepted this is only game one out of five and each game we show you will be crazier than the one before yes yes this video is sponsored by game maker and the reason i chose game maker for this challenge was because it's so insanely fast to build stuff my first ever video game that was about 20 years ago was made using game maker and i recently released a game on steam called will you snail and i made it using game maker gamemaker is the perfect choice if you want to make 2d games that's why i recommend you click the first link in the description and try it out for yourself for free free three going oh man this is awesome here you go ten lines of code this makes the duck fall this makes the duck jump this makes the duck rotate this makes the duck die and this makes the gates move towards you easy
what should we create next maybe something more difficult let's build a simple level the next game i made is a very original a game that is definitely not inspired by any other games it's called break up yeah okay this is how the game looks so far so nothing's moving nothing's happening let's add some code i'll put the code into the step event so that's basically the update event that gets called every single frame i'm gonna say x equals mouse underscore x i think that's all i have to do to get the mat moving so let's try that out i can now move the match down there by moving the mouse left and right that's working as intended next up i want to make the ball fall downwards but i don't just want it to fall through the mat i want it to bounce off of the mat place meeting x y object matte so that will make the ball bounce upwards and that will allow you to control the direction oh yeah one more thing i wanted the ball to bounce off of the walls as well so i'm just gonna
right move bounce solid okay let's let's see what happens okay um i think it's more or less working the balancing is off speed 25 here and divide the speed by 8 yeah that's great i like it now we'll save some more space like so and now we have like four more lines of code if we want to so basically that just checks if the destructible block is touching the ball and if so dang it i'm really running out of lines here it's slowly starting to get more and more difficult here i had to see what's possible with 10 lines of code like what can i realistically make so slowly working my way up there [Music] it's working all bounces off these blocks the collision behavior with like the blocks is not always perfect but pretty reasonable for for the amount of code we used but i think we can take this a little step further because i also made
these multi-ball blocks and i wonder if we can get those to work i think i can save quite a lot more space actually by doing it like this oh my god it looks so confusing ah i mean it's working so far yeah yeah oh oh god i can't juggle so many bars i can't believe we did that with 10 lines of code i can't believe it actually i want to see if i can make these blocks look a little bit cooler gimmick has a pretty awesome built-in sprite editor so i used that to give the blocks a bit more of a 3d ish look then i put a screenshot of the game into photoshop and painted a custom vignette which is one of my favorite new tricks doing that by hand and adding some random sprinkles of color here and there really adds a lot of personality to the look okay there we go not too bad huh ah that's what i'm talking about that what i'm talking about yeah whoa there's a lot of balls there yeah i'm happy with how this looks perfect i'm gonna keep it like this now okay new game and i want to make a game about
fish wow game maker was recently bought by opera and ever since i think money has been flowing into game maker like crazy because they're adding features like crazy one of the recent features they added are these cool effects layers which you can just slap into the room and bam you have a nice looking effect one of a really nice looking ones is this water effect for example so i really wanted to make a game with water i like water who doesn't like water okay now in the step event let's make the fish swim towards the mouth yeah i'm not entirely sure i like how this looks yet but you can make them fly towards your mouth and i don't entirely know if i like how that looks yet either i probably don't buy fish okay i made sure that they always face the direction they move and i can simply do that by setting the image angle to the direction and then i use this to add some damping to the movement so they don't get too fast and kind of slow down
again then for the fish itself i'm gonna try to rework that from scratch i want a more green fish okay already looks a little weird how they're all moving so synchronously oh that looks cool though okay i now added some randomization to the movement direction when you press the mouse and i did that just by adding some mathematical functions here to the point direction between the current position of the fish and the mouse i spent an insane amount of time just on fine tuning the fish movement i just kept restarting and being like oh no no no that's not like how fish move this doesn't look like fish yet no i gotta change how they move and i did that for like two hours you can just keep tweaking the same lines like forever and for some reason it keeps getting better and better the more you do it it's kind of funny okay i played around with the look a bit more and i think it looks pretty dope as long as the fish are not moving too quickly looks fairly nice um yeah i need to get
some gameplay going here i feel like um fish movement is good enough let's make something with this this was one of the games where i wasn't really sure at the beginning where i was gonna take it that's always a very fun process when you're kind of surprising yourself with the end result i just knew i wanted to make something with water and with fish i added enemies and voila there was a game that i didn't expect i didn't plan to make this but what it ended up being was like a very weird zen-like game that in some way feels kind of relaxing you know you control these beautiful fish you see the beautiful water and yeah all of your fish get eaten by like super stressful piranhas that are like and yeah the the coat i think turned out relatively long but not the worst okay no that was the longest line of code i probably wrote during this challenge should i even try to explain this code i feel like i probably couldn't even explain it to myself oh my brain hurts by the way if you're wondering about the exact rules of this challenge especially for all of those
programmers out there who wonder why don't you just do it like this and separate everything with a semicolon then you can write as much as you want in one line obviously using semicolons is not allowed gamemaker doesn't require you to use semicolons or anything that cheats you out of having to use a semicolon is not allowed either so yeah putting two functions right next to each other like this not allowed this is not allowed this is not allowed the only thing you can do is putting if clauses and functions next to each other and put putting functions inside of each other those are the rules uh nerd stuff over and out i have even more ideas so let's see how far we can take this okay let's make a car game oh god that car is way too big now let's make the car move there we go this is one line and this should make the car move forwards and backwards okay this is more or less what we wanted i can press forwards and backwards the only problem is it doesn't never stop moving so actually if i for example accelerate it forwards and then
stop pressing anything it just keeps moving and moving and moving okay this is like the most basic implementation i could come up with with this code right here i should be able to rotate the car to the left and to the right now let's test that i know this is not how cars usually rotate but i will address that in a bit so this is more feels more like spaceship movement so far okay let me see if i can fix that not bad we can have a fully functional car now like we can drive in circles you can go backwards if i keep the right button pressed and i press forwards and backwards i keep moving on the circle so that's pretty much exactly how it would behave on a normal car for the sake of testing i added quite a large amount of drift and as you can see here i think it's working very cool then i even managed to make some cool car trails work from a performance perspective the solution i took for the for the car trails is absolutely horrible because i spawn a ton of tiny black objects basically to paint the trails but very efficient in terms of the amount of coat
i needed to do this i think i managed to fit this in one line yeah yeah it's really fun actually but we're not done yet no no no i have more ideas i exceeded my expectations even more because i suddenly figured out hey wow i can basically just by changing the balancing of the numbers change like the behavior of the car make it feel like you're driving on a different surface or something if we're colliding with the ice we'll just multiply by question mark 0.99 otherwise we'll use the other value that should work honestly i could have added as many surfaces as i wanted but i decided to go only for a few you move completely differently on all of these but they all use the same lines of code all i change is the numbers in those lines and that makes it extremely efficient in terms of the number of lines i use okay now this time i had to put the code into two different events here we have the seven lines for the car movement and then in the draw gui event that's where you can draw stuff i drew
two health bars at the top one health bar for how many collectibles you already collected and then here one health bar for how much time you have left and if you run out of time before collecting all of the collectibles the game restarts and go i'm gonna give it my best herb [Music] [Applause] [Music] no i feel like making some kind of puzzle game now i have actually no clue what i'm gonna make but that's the fun of making a puzzle game you can just get started and figure things out as you go maybe something with city building as well i felt like this was not going anywhere for a long time i was just messing around and it didn't feel great i didn't know where i was going at all i was just playing around i had no plan
for the game i think next up i wanna get some sort of building review going so i can see where i'm gonna build next something like that i remind you so far we only have four lines of code and i mean yeah the alpha is pulsing a little too slowly but other than that pretty much everything works that is pretty crazy okay next up i wanted the tile full of grass and flowers yeah damn it i forgot that it animates automatically that's not good but there's an easy solution we just have to split it into separate sprites one sec okay time to test if it works can i build the house yeah can i build the road yeah and i should get random objects to place now that is cool okay now we gotta worry about gameplay oh god i'm about to do the unthinkable i'm stacking three for loops inside of each other in just one line i wrote a crazy complicated
system for cellular automata so basically everything you build starts spreading automatically oh my god it crashed and gave an error message and fitting that into 10 lines of code it was such a nightmare and then i played it and then it felt horrible because you felt completely out of control right when you you basically have zero impact on how the finished thing looks like because you're only placing like the these tiny little things and everything just grows so much by itself but then once again that shows how much impact good balancing can have and just tweaking the numbers a bit and i i really believe after this challenge that we don't focus on that enough the only thing i changed about the balancing is that stuff doesn't spread as quickly anymore and it felt so much better after that okay now that the placement system is a little more fun i wonder what happens if i just add more sprites to it for example i could add trees i could also add some water or something let's let's just see
what's nice and it was such a different game after that suddenly it really clicked it was really fun in the end it turned out to be a creative builder but it still has that puzzle component because you're thinking i want this to look like this but then things also starts growing automatically so you kind of if you want something to stop growing you have to cut its way off or you have to make something different cut its way off by automatically growing there and it becomes this really interesting game of okay where do i place stuff where where do i want to put my creative intent and where am i fine with things just growing and spreading automatically the game builds with you it's basically a cooperative building game where the game builds with you and that turned out to be really surprising fun okay so this is the finished code for the builder game and it's crazy we actually managed to do it with nine lines and i have no clue what to do with the last line so we're just gonna leave it at nine uh but yeah some of these lines are like oof crazy long holy moly oh it doesn't even
end there it keeps going whoa imagine having to debug that wow yeah this is the best one that was probably the most fun i've ever had with any of the gamedev challenges i've done so far so thanks to gamemaker for supporting videos like this if you want to support them back click the link in the description to try out gamemaker for yourself try this challenge if you dare coding is not as hard as you think and i'll see you in the next one bye
This challenge explores the creative potential of game development under strict constraints, specifically limiting the codebase to ten lines per project. Utilizing the GameMaker engine, the developer demonstrates that complex mechanics, physics, and gameplay loops can be achieved through efficient logic, nested functions, and careful balancing of variables. The project highlights that while code volume is restricted, the depth of gameplay is primarily driven by mathematical tuning and iterative design rather than the sheer quantity of lines written.
The development process spanned five distinct game prototypes, each increasing in complexity. The initial projects focused on fundamental mechanics, such as object movement, collision detection, and bounce physics. Subsequent projects introduced more sophisticated systems, including randomized AI behavior for fish, vehicle physics with drift mechanics, and cellular automata for a procedural building game. By leveraging built-in engine features like sprite editors, effect layers, and GUI drawing, the developer successfully created functional, interactive experiences that evolved from simple movement tests into nuanced, zen-like, or puzzle-oriented games.
A key finding from this experiment is the critical role of balancing. In the final building game, the developer utilized nested loops to create an automated growth system, which initially resulted in chaotic, uncontrollable gameplay. By adjusting the growth rates and numerical parameters, the experience shifted from a technical failure to a cohesive, cooperative building mechanic. The challenge concludes that even with minimal code, developers can achieve significant results by focusing on the interplay between player input and system-driven logic, proving that constraints often serve as a catalyst for creative problem-solving rather than a barrier to functionality.
Comments