Skip to main content

Code Like a Dragon Spotlight - Infininte Coloured Cubes

 Hello. C J here. I’ve got some early morning Dragon Engine and Code Like a Dragon updates for everyone. Dragon Engine is my main video game project and Code Like a Dragon is the set of Quantum cards for the card game Quantum I’m making to record each step I take. I want the whole process of setting up the video game to be repeatable so I’m putting it step by step on cards. My current project is a smaller game I’m doing to practice, March on Ishrayl.

March on Ishrayl will be in the genre I do, open world exploration based hack and slash. The first step is to make the terrain. Okay, so this probably sounds like I’m making a 3D model with ground and trees and putting the player on top of it. Not quite. I’ve spent ages looking into the best way of making terrain in bulk that also looks good. The land is made out of modular tiles, or at least I call them tiles. They’re one metre tall, eight metres wide and six metres deep. All of this is being done in GDevelop because it’s fun.

I’ve got one of them made out of one of the starter shapes that come with the GDevelop default third person platformer game template. The template is also free. This is a thing I learned along the way. Don’t invent anything from scratch. Take an existing thing and tinker with or alter it until it suits your goal. I took a black cube platform and duplicated it then renamed it. It’s now named bedrock and is tile sized. So now I have a black tile in the right size.

The goal is to be able to click on or tap on a bedrock and get a menu of landscape tiles. Click or tap on the one you want and the bedrock spawns one of them above it flush with its edges exactly. This is a thing I don’t have a template for or a sample already made. My first step was to make sure that tapping on an item while on a phone screen can spawn another item. Then I’ll make a lookup table and assign the menu one of each terrain tile. The tiles can be repeated and there won’t be that many different ones in one map.

So the thing worked. It worked the first time. I added an event to the game as a whole in the top-level events panel. You can see the text of the event in one of the screenshot compilations below. I set a condition that when a bedrock is tapped on it makes a movable block. The movable block was my default to try the system out. Then I needed to enter in where the new block spawns. I picked that it spawns on the bedrock equal to its coordinates.

Then I loaded the game in player view and walked the little default character over to the bedrock. I tapped on it and on the top far corner it spawned exactly what I wanted, a movable block. The fun part was that I didn’t add in a way of making it spawn only one movable block. Soon there were physics based objects tumbling into the abyss and flying off the screen as I held my finger on the item. I stopped clicking and it stopped. I spawned a second bedrock in the editor view, returned to play view and checked that the bedrock both can do this and that only one activates at once.

Next I need to colour these new blocks in. The final game will have one tile above each bedrock and only one. Then a variable in the bedrock switches from false to true showing that it has already been used. From then on the tile can be edited to swap it with another tile. Then I can build the entire map, including houses and climbing pathways, in the play editor. At least that’s the end goal. Then I can reuse the entire system later to build and save level maps for final use. I have one top of block texture done and ready to show here as well for a forest mountain biome. This worked. Time for more flying blue cubes.

C J Mcpherson




Comments

Popular posts from this blog

Four New Recipes for January

 Hello. C J here. I've got four new recipes for everyone here. We have everything from Chinese chicken to homemade hot apple cider. Enjoy. The Emperor’s Potatoes Here we have the first food item I ever finished designing for Food of the World – Carthia. I tried three combinations of traditional Asian ingredients and pasta under the assumption that I was doing Italian-Chinese food for the book. I could not for the life of me get any of them to be exciting. They were fine. I don’t eat fine. I got bored of the pasta thing and then thought to myself, ‘what happens if I swap the pasta for another starch? What about a potato?’ It worked. Really well. It worked so well I named them The Emperor’s Potatoes. They’re mashed potatoes and I left the skins on because I like vitamins and then that got me thinking about the traditional medicinal food of Ancient China, ginger. Could I put ginger in a potato dish and have it work? Yes. I can. That surprised me. Be warned, these are almost dangerousl...

Recipe - Lemon-Lime Soda

 Hello. C J here. I have here a recipe for homemade lemon-lime soda. This beverage is just as sweet as the original brand it’s based on but has actual lemon juice and lime juice in it. It tastes similar but not as acidic. Strangely this recipe worked the first time I made it. It’s mostly glucose syrup, which any chemist with my knowledge of food could make in a home kitchen. The recipe makes four cups, each one to be served over ice. One cup is mostly enough for one person. Ingredients One Cup Sugar One Half Cup Water One Tablespoon Lemon Juice Three Tablespoons Lime Juice Two and a Half Cups Soda Water For the Glucose Syrup Mix the sugar and the water in a medium saucepan. Put over medium heat and stir frequently until the sugar is dissolved and the liquid is clear. It should still be thicker than water. For the Soda Measure out two and a half cups of soda water. Pour into this the glucose syrup in a heat proof one quart measuring cup or other heat proof vessel. Add the lemon juic...

Chocolate and Barbecue Sauce and Truffles Oh My

 Hello. C J here. I've got two new recipes for everyone today. I meant to type up a third but for the life of me I can't find the paper index card I wrote it down on. I will have to make it again and post it later once I double check I have the right proportions. I know what's in it but the proportions are done by taste. It's for Asian style ginger baked beans as part of my Asian-barbecue book I'm working on. The book might actually end up being cards for the card game because the recipes are so simple they fit in that format. That makes my job easier. Here's our two recipes for today. The first is a new Asian style barbecue sauce I invented from scratch. This isn't based on an existing sauce. It's the product of a lot of planning and research. It's great. The second recipe is for my final draft scratch made dark chocolate. This stuff is good. I still have some of the batch I made three days ago on hand. It's too tasty to eat. There will be a mil...