Journey Start


TL;DR: I make neat game in one hour, nice.

I am, as of now, 6 hours into my second game jam. I decided to start my own game jam, as my other projects weren't getting anywhere. I remember loving how productive I was during that first Yogscast Game Jam, and thought a bit of change of pace from this virus would be nice. This is of course intended to be a minimalistic version of slither.io. I was watching a video on indie game dev, and thought it would be nice to make a game in one hour. I started with the petri dish, and started the timer. I used Waifu2x to upscale the image, though it is meant for art - the effect is minimal, but an overall improvement from the original piece (it is quite hard to find good shots of petri dishes from the top without a watermark.

The next ten minutes were spent getting the project started in Godot, and loading in the sprite of the petri dish. Then I made the player model in Gimp. The player model is 400x400 so it took some scaling work to make it look like it belonged on that petri dish. The rest of the time spent was a puzzle...

How do you get something to move in a circle? You could cheat and make a navigation mesh with four waypoints, make it move to each, and call that a circle. I settled on investigating the code I used for my last game jam, it is rather well organized for jam code. In it there is a concept of a direction variable. This is a Vector 2 with two inputs, x and y. A vector is represented as a direction from a start point. You could have a Vector 3 and that would be a vector in 3d space with a x, y, and z. So I input the starting direction as (1, 0), that means positive 1 x, no y. This translates to right, that way the creature would be moving clockwise. The next step was figuring out how the hell to make the little guy move. 

This is simple function in Godot - if you set something as a Kinematic Body, you can provide a variable that equals a move_and_collide() function. Then you input the direction multiplied by the player's speed, in this case 2. Then I needed to figure out something else, the one button mechanic. I did this by having a move variable set to 0. If it is equal to zero - make it move in a straight line. Then was the hard part, figuring how to make it move in a circle.

I never learned how to do that. I couldn't easily find any resources online - here you will find my tip for making this possible, though it is more of a hack than anything. The goal is to make it move in a circle, how do you do that? By changing the direction. The direction can be any number, as long as its a vector 2 with two numbers - both of which could be any real number. So to move down you would need this, (0, -1) for down. So the goal is to turn a starting vector (1, 0) into (0, -1). So I made a four step solution that would solve for the whole circle. I made a series of if statements that check for each of the four cardinal directions. I go from right to down in two of those steps. First I check if we're set to right, and our second number isn't set to up. If so that means we need to turn, I do this by incrementing direction's y coordinate by a new value - turnspeed. I set this to 0.05.

That's the first step, the first quarter of the circle. I'll let the rest remain a mystery - but try it out in Godot! You can get it on Steam, load up a new project and find yourself a nice sprite. Then make a new scene with a kinematic body - watching a tutorial video (such as one by GDQuest) can help with this part. Give it a collision shape 2d and a sprite. Set the collision shape to a circle and give the sprite a texture. Then give the kinematic body a script in the scene viewer in the top left. Then reread these last few paragraphs to help you build your script. If you have no errors, and the script looks like the start of something push the F6 key. That's my tutorial for Godot, hope it helped.

With that out of the way - a new problem emerged. The little barticulus worm would just shoot off into infinity at mach 10 speeds. The problem was that the velocity needed to be clamped. As direction should always be a number between 1 and -1. I did this with the min and max functions - I'm not sure how much this slows down my game, but a better solution would be preferred. After that I handled input - I wanted controller support for multiplayer functionality, but only one button was needed. Either it would move in the circle we just made or it would move straight. I handled this by setting two if statements, if one was true - pressing the button would set the other to true. A flip flop.

In the last minute I imagined making the little guy die if he touched the edge like in slither.io. But even with the space set in collision space - there was no time. The time until now has been spent publishing the project, downloading a virtual machine for testing, getting a video on youtube, writing this devlog...

Speaking of devlongs, this one should end right about now. I've now spent about as much time writing this as I did making the game, and I have 41 hours left to make the game in time for my deadline and I need to sleep. What to do...

Files

Slither Minus - One Hour Edition.zip 14 MB
Apr 27, 2020
Slither Minus - One Hour Edition.x86_64 40 MB
Apr 27, 2020
Slither Minus - One Hour Edition.exe 35 MB
Apr 27, 2020

Get Slither Minus - One Hour Edition

Leave a comment

Log in with itch.io to leave a comment.