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

Chinese Food That is Very Saucy

Hello. C J here. I read a lot of cookbooks. This is done mostly for fun. I’m currently reading a short but really interesting book about traditional Chinese cooking. The book was written by an Indian author who has clearly researched Chinese food very well but some of the translations of recipes or concepts get a bit strange. I’m currently done the soups and starters section and am onto the section labelled ‘food that is saucy.’ Cool? Is it also savvy? There’s a surprisingly large amount of ketchup in the recipes. No I don’t think I want a recipe for hot and sour soup that is thickened ketchup water with vinegar and a bit of cabbage. No I also don’t want to take a slice of white wonderbread, roll it into a tube, stuff it with canned corn, deep fry it and then top it with sesame seeds. What in God’s name do they eat in China? And why is it specifically an image of white wonderbread? China? Are you okay? I managed to take out the vinegar, water and corn starch that makes up most of the h...

The Tunnels Under Haven

 Hello. C J here. Walking down the streets of Haven is not always as safe as the city would like people to think. Yes, they have curbed the banditry that plagues the Southern half of the Coastal Road. The Desert Princes whose cities dot the Southern coast of the Southern Continent if anything make the problem worse for themselves with their constant rivalries and politics. So no, a traveller in Haven or in the River Lands is unlikely to meet a bandit or other criminal sort. But then there’s the walking dead to consider. Many of the basements, catacombs and landmarks of Haven have old foundations from before the city had its current name. In ages long past it was one of two competing capitols for the Desert Empire, both of which unified under the first Sand King of the Gold Dynasty, the God-Lion. It was never his place of residence and both the other capitol and the rest of the Desert Empire are long since buried under the dunes. Well, people like to assume they’re buried. People wo...

Let's All Be Friends, No Really - Part Two

 Hello. C J here. I’ve updated my plans to make a Discord server for everyone here and on Facebook. Making a Discord server to my knowledge costs money. However, making a Facebook group does not. I’ve made a few of those over the years as well for various reasons. I’m going to look into this soon and then add the links here and in the menus here as well. I’m certain a Facebook group is what we need. I’m planning a number of chats within the group. So far my current plans are as follows. Art and Artwork Health and Wellness Food and Baking Magic and Spirituality Writing and Software NSFW I’m planning a private group but if I can get it open entry without a form or sign up page or anything. As for rules I’m going to reuse some from past of these I’ve done. Everyone is Welcome Be Polite Advertising is Allowed Follow the Content Ratings The Facebook group will take some planning but not any actual effort to build. It’s that simple. Thanks. C J Mcpherson