aelmosalamy / ascii-combat Goto Github PK
View Code? Open in Web Editor NEWA simple CLI text adventure game, created for learning purposes, feel free to contribute.
License: MIT License
A simple CLI text adventure game, created for learning purposes, feel free to contribute.
License: MIT License
Hello! I was thinking of developing an autocomplete feature. When a user writes go, look, pick, drop, eat and presses tab a specific set of options show up one by one with each press. Does it sound good to you?
Who is Bori and why can't you select a name from a list and assign it to the player? Could at least offer a wizard, elf, rogue, etc... Want me to submit a PR?
Action delays are a short 3-5 second delays with a centered text displaying 'Loading . . .' or whatever, the point of this is adding slight depth to the game, instead of looking like a website and pages instantly switching pages, the game screen would take sometime to be displayed after specific commands that indicate hard work e.g. moving from one room to another, extracting something from a mine room (Future plans) or when transferring from normal room to a fight/combat
I have noticed that the terminal window doesn't resize on Linux (tested) and probably it is the same for all UNIX-based systems, but I'm not sure why is that happening, I recently installed Ubuntu and did some tests on the game. So I am keeping this issue up for now
ASCII Combat currently needs a "generate_dungeon" function, I will be adding a new attribute to all rooms called "gen" and basically this attribute is an array with 2 elements, the first element is the "generation method" it can be a specific number (This room can be found n times in the dungeon), it can be a percentage (This room have n/100 rarity to be found in a dungeon), or maybe it can be a room which unique (only once) or a room which have a special interaction (this can give chance to introduce new room ideas: Arena, Puzzle Room, etc.. I got some plans in mind ...
Anyway, generate_dungeon pseudo code
This is the next step after implementing combat!
In dungeon.py line 279 it asks which weapon to use, but then only prints the available weapon. Where do you select the weapon? The loop then goes back to the main. I can't initiate the combat.
Line 303 in dungeon.py is wrong:
if arg.lower() in (current_room[GROUND] or current_room[SHOP]):
This doesn't work correctly.
It should be more like:
if arg.lower() in current_room[GROUND] or arg.lower() in current_room[SHOP]:
But even that won't work correctly, because sometimes current_room[SHOP] is None.
For example in a location there are multiple items that available for picking up:
apple ... coin
So the player could type:
pick apple coin
And those items would get picked up one after another.
EDIT: Same mechanics can be applied to dropping items.
The main game screen even thought it will be text-based, It must be attractive, by attractive I mean colors/options/split views etc.. all of this features can be added with a curses-like TUI module.
I didn't decide yet but options are:
After some research and brainstorming for the actual needs and functionalities to be in the main game screen I will choose one of these modules to adopt in this project.
EDIT: I will choose a library called colorama It supports windows as well as unix, It will be nice to get rid of the monotone hell in the AC's Combat system, I will post a color scheme for the game soon
here is a picture of colorama in use
Some ideas to be implemented:
(Those are all prototypes for some fancy skills, feel free to give any recommendations)
A Freeze/stun skill
This prevents an enemy from attacking you for n turns while dealing n dmg
An insta-execute skill
This skill executes any enemy immediately, in return, you lose n% of enemy's hp
A tough skin skill
You take -1 less dmg from all enemy attacks for n turns
So, I guess that is it to do ๐
The goal is to keep this repo clean and slim while having colorama
updated from pip.
This can easily be done by adding a file that states that colorama
is a required dependency, and state in readme that:
Installation is done via:
$ pip install -r requirements.txt
Is this written for python 2.x or 3.x?
The error is in dicts_init.py_
line 20:
SEP = ' โ '
The file ac_dicts.py is getting bigger and is almost getting unreadable, 350+ lines with just 8 items and 5 rooms, so I was thinking about storing and converting all the data into .YAML files using ruamel.yaml and then whenever I am adding new items I add it to the YAML files, It will be more efficient and it will make ASCII Combat's files cleaner and more organized, ac_dicts.py will contain extractor functions and some random utility functions with the main purpose of reading the YAML data
EDIT: I am currently doing some research on either I should use ruamel.yaml or use Python's pickle, currently I give 1 point to YAML for human-readability
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.