Forem

0 seconds of 0 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
00:00
 
Andrew Brown 🇨🇦
Andrew Brown 🇨🇦

Posted on

26 5

Delta-Eos (ASCII Detective Sci-fi game) - Starting to Play Like a Game

I am getting close to having all the core functionality in the game:

  • skill system (working)
  • experience (working)
  • dialogue engine (almost complete)
  • object interactions (nearly complete)
  • inventory (just starting)

How to run the game

Its open-source so if you want to try whatever I'm working on you can just download the repo from GitHub at https://github.com/omenking/delta-eos

To run the game:

bundle install
bundle exec ruby main.rb
Enter fullscreen mode Exit fullscreen mode

Experience and Skills

So for the experience, I decided to use square root. The level is dynamically calculated based on the collected experience.

  def level
    (0.08 * Math.sqrt(self.exp)).floor
  end

  def next_exp
    val = (self.level+1) / 0.08
    (val*val).floor
  end

  def prev_exp
    val = (self.level) / 0.08
    (val*val).floor
  end
Enter fullscreen mode Exit fullscreen mode

Every level you points. I keep track of points_used to determine how many points you have avaliable eg.

(data.level - data.points_used)
Enter fullscreen mode Exit fullscreen mode

I now have this cool overlay you can use to upgrade your skills when you have available points.

Cool New Rooms

I don't plan too far ahead, I just make rooms interesting and determine their purpose in the story after the fact.

So I will think "I want a big gate that opens as you approach it"

Dialogue Engine

I manage dialogue within JSON files. I've most or less define the structure for all possible outcomes.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (2)

Collapse
 
bootcode profile image
Robin Palotai

Video opening screen first thought: why are there pants? ;)

I'm fond of ascii games, good luck!

Collapse
 
andrewbrown profile image
Andrew Brown 🇨🇦 • Edited

(in-universe explanation) The space dynasty outlawed pants. Only the Space Emperor is allowed to wear pants or you face space execution.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay