Game
It's a Cube
3 years ago

​When I started this project I hadn't fully figured out how everything was going to work, so it took me some time to set it up to where the ground and the cube would interact, and I want to share how I did this.

https://youtu.be/XXEmMv52EDc


It's a Cube Devlog #2 | Cube and Ground Interaction
Welcome to another devlog! I took a couple of weeks off after my last Deathly Descent devlog about the achievements in DD, which is linked below. In today's ...
https://www.youtube.com/watch?v=XXEmMv52EDc

The central mechanic of It's a Cube is that you score a point when you face the correct face of the cube towards the  ground, in-game you'd know the correct face because it's the one colored the same as the ground. I guess at it's center this game is about matching colors. In order for this to work, at some point the color of the ground and the color of the cube face you just turned towards it need to be compared via script, and this took me some time to get working, so I wanted to share how I set this up.

The first thing I needed to do was set it up so the ground's color would randomize, and this was probably the easiest part, all I needed to do was randomize an integer value between 1 and 6 (for 6 sides of the cube), and I wasn't worried about the visual color change just yet since I could easily map each number to a material later once I had everything working on the technical side.

In order for the cube to interact with the ground when it's rotated, I childed 6 triggers under the cube object and positioned one by each face of the cube, these would act as my way of telling the ground that the cube has rotated through the OnTriggerEnter method, which is called whenever the object that the script is attached to enters a trigger. After that I created a simple script for the cube triggers containing a single number (again between 1 and 6, and this time in correspondence to the sides of the cube) and from there I could compare the grounds number to the triggers number whenever a trigger hit the ground, and if the numbers match, then I add to the players score. 

With all of this working internally, I then wrote a third script that would set the grounds material based on what it's current number was. The trickiest part of doing this was making sure I ordered the array properly so that each number matched correctly with it's material array index. One misalignment would cause the grounds color to appear different from the color of the correct cube face, which would be very confusing for the player. Not gonna lie I did make this mistake at one point, luckily it's pretty easy to fix if you do! With that done, the basic functionality of It's a Cube was pretty much complete! This all took me around an hour total, and from there I could expand on these scripts to add sound effects and implement them into a game play loop. I hope you found this interesting! Thanks for taking the time to read this!



0 comments

Loading...

Next up

I DID end up making the body and elytra both 1 cycle/s and the wings 6 cycles/s. I'm working on a video of the animation itself playing in the Unity editor so you guys can see it properly. I think it turned out well!

Here's a short demonstration of the beetle shell power-up in-action! It's not very obvious what it does at the moment because I still need to work on a lot of the effects for it, but the functionality is there if you pay attention to the health bar!

I've been working on some proper visual art for the beetle shell when it's equipped! I've also gone ahead and drawn a break animation for it. All I need to do now is actually set all of this up in Unity which I'll probably do on Tuesday.

Madeline is the main protagonist of the mountain climbing platformer, Celeste. The game has been praised for its visuals, gameplay, and introspective narrative. The game's creator Maddy Thorson confirmed that Madeline is trans in 2020.

The beetle shell is now fully VISUALLY implemented! Next thing on my list is a unique sound for Hensen equipping it.

Dive into the cozy post-apocalyptic open world of Critter Cove!

Gentleman Rat Studios (@GR-Rob ) describe it as “a little bit Animal Crossing, a little bit Stardew Valley. Maybe even a little bit Windwaker, too."

Wishlist the game: https://bit.ly/CritterCove

I'm working on an update for It's a Cube! I've implmemented Game Jolt's API and added 4 trophies and score saving.

My next project! It's still in the early stages of development, but I have a tech demo available for download.

Happy Video Game Day!

July 8 is Video Game Day, a holiday that's obviously close to our hearts at Game Jolt.

Celebrate by completing our quests! They won't be around long, so get the rewards while you can.

I've updated the UI and HUD in It's a Cube! I think the HUD especially looks a lot nicer now, and I'm especially proud of that, but I've also made changes to the main menu. I've also finished the statistics screen I was working on last weekend.