The Code Structure Of Tweet_Dungeon (😢 Tweet_Dungeon dev log #2 πŸ’€)

avatar
(Edited)

zeldabannerLARGEcolorpaletteh.png

previous dev-log
next devlog

🧬🧬 The Code Structure Of Tweet_Dungeon

Making a game can be a hefty ordeal. Various API's, complex algorithms, and a lot of code go into making Tweet_Dungeon what it is. Today, we're going to take a nerdy look into how I manage the game logic behind the scenes, and tips I'm using to stay sane working in this codebase.

divider.png

πŸ“‚πŸ“‚ Folder Structure

In an effort to stay sane, I decided to split up the code into various, isolated parts.

The CORE folder contains the core mechanics of Tweet_Dungeon (dungeon generation, player controller, world config, enemy behavior, etc.). This code won't actually display anything onto your screen, and won't exactly work on its own.

Then, we have the... Well, everything else. The beauty of isolating the CORE game code, is that you can then basically "drag + drop" it into your own game version.

For instance: There's currently a rough prototype of Tweet_Dungeon available here. This can be considered a game "version". Any changes I make to the core Tweet_Dungeon logic can be automatically pulled into the prototype to keep it updated.

If you're aware of the concept of the Git File System, then you can think of the core Tweet_Dungeon logic being a repo (that's because it actually is...) that you can fork, modify, clone, and include in your own variant of Tweet_Dungeon.

as you can see, we store the isolated core game logic in its own folder

Speaking about Git...

😻😻 Open-Source, Of Course!

Tweet_Dungeon will, in fact, be open-sourced upon release. There are currently 3 GitHub repo's that we use:

  1. Tweet_Dungeon-CORE : the main code & game logic that is required to run Tweet_Dungeon
  2. Tweet_Dungeon-TWITTER : the specific Twitter bot code that allows play through Twitter
  3. Tweet_Dungeon-CAVERN-KIT : a set of pre-made dungeon "rooms", called caverns, allowing you to quickly bootstrap your own version of Tweet_Dungeon

In addition to these main game repo's, there's also a handful of tools that I've made to help with the development of Tweet_Dungeon, and I plan on open-sourcing those in the future, after the game launch, as well :^)

πŸ› οΈπŸ› οΈ How Do You Work With It?

Actually, it's a rather simple method! First, you'd clone the CORE game logic into your version that you're working on, and then you'll need to import the objects that we export in each script.

import WORLD from '@/core/world.js'
import RENDERER from '@/core/renderer.js'
import PLAYER from '@/core/player.js'
import ENEMIES from '@/core/enemies.js'

When you're game is set-up and ready to run, call the WORLD.init() function, and pass it the reference to RENDERER, PLAYER, and ENEMIES. Remember, call this method when booting up your game (for instance, if using VueJS, put this into the mounted() life-cycle hook):

mounted() {
    WORLD.init(RENDERER, PLAYER, ENEMIES) // initializes the game world
    WORLD.generate_random_dungeon() // generates a random dungeon
}

This will take care of initializing the game code, and you can then start playing your own version of Tweet_Dungeon! Additionally, this makes it easy to swap out any code that we provide, with your own custom code, giving you full control & customization over the game. Everyone gets a game!!!

you get a game! and you get a game! EVERYONE GETS THEIR OWN GAME VERSION!

We want to give indie-game-devs a jump start with making their own clones of Tweet_Dungeon. We have big plans for this game. First? Twitter. Then? THE WORLD!
(no, but seriously, we have tons of stuff planned for the future. various game versions, wonderful new worlds, many different mediums, and much much more!)

ℹ️ Nitty-Gritty-Code-Details

Here's some Tweet_Dungeon development fun-facts to end on:

  • Programming Language: JavaScript, my favorite language
  • Emoji Library: Twemoji (twemoji.twitter.com)
  • Frontend Framework: VUEJS (vuejs.org)
  • Current CORE Game Code Size: ~50kb, so far ;^)

divider.png

newbanner.png

What Is Tweet_Dungeon? πŸ˜ΆπŸ’€

Tweet_Dungeon is a Twitter-based dungeon-crawling roguelike game, where the entire game (moves, attacking, looting, exploring, etc.) takes places entirely on Twitter. Players vote on what the little adventurer will do using Twitter polls. Turns are 20 minutes long, and updates constantly all day long.


Follow along with my progress where each day I'll post a short dev log showcasing the latest stages of the gameplay. Will I be able to make the deadline of Thanksgiving (November 28th, 2019)? Only the game-dev-gods can tell...

T-6 DAYS...

πŸ‘‰ Follow Tweet_Dungeon On Twitter To Play When The Game Launches! πŸ‘ˆ
previous dev-log
next dev-log

divider.png

BlankBanner.png

twitter
instagram
main website
mystery attic
Twitter.png
Instagram.png
StuffBySpencer.png
MysteryAttic.png

take care! :^)



0
0
0.000
6 comments
avatar

@tipu curate 2
@untersatz curate 2

0
0
0.000
avatar

Congratulations @stuffbyspencer! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 4000 upvotes. Your next target is to reach 5000 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness to get one more award and increased upvotes!
0
0
0.000