samuelvary1 / fields_of_peril Goto Github PK
View Code? Open in Web Editor NEWAn adventure game
An adventure game
Need to make this say what direction if you only type go instead of crashing
This could appear on a letter that the player picks up and reads, like in Zork, but it could also just be whenever you type help. It should explain how some of the riddles work, answers should be converted to numbers to use as keypad codes, etc.
An example would be, you step into town square for the first time, a guy pops out and asks you a question, if you answer it correctly he tells you a keypad code. if you answer it wrong, he can say sorry, but anytime you're in the same room you can type 'talk to.. ' and he'll ask you the same question (and maybe can have more complex multiple choice conversations later)
If you leave the room you start out in (type 'go west' to emerge into the stairwell outside the apartment) and then go back inside ('go east') it still displays the chapter 1 header and the first_time_message still appear. They should only appear the very first time you start the game.
This bug doesn't happen when you go in and out of any other rooms so it's something to do with the initialize_message method.
These are directions to new rooms that can only be accessed using special knowledge or equipment. It can be a locked door that requires a specific key, rotten stairs that require knowledge to pass safely, and so on
If you have a container in your inventory, even if it's there and open, it says you can't find any containers
This should reveal the object's detailed description and if it has knowledge == true, then this should be added to your avatar's knowledge array (along with commensurate points increase)
This will probably be pretty tricky to implement but need a way to save the exact state of the player's game (location, score / progress, inventory, item locations in all rooms, etc.) that can be loaded at any time, or automatically when you start the game. Or there should be a menu when you start that says 'new game' or 'load game' basically. If you get killed in the game as well, it should also prompt you to load from your most recent save. May be possible to have multiple save slots but that will be really hard as well. Might be more feasible to only have one possible saved game.
This should be pretty straightforward.. and it will accompany the ability to talk to NPC's as the only real interaction with them (there might be multiple choice conversations later, I'm not sure). You may find out what they want by talking to them, for instance. Then, if you give them the correct object, they will either give you something (key gets added to your inventory, with a message) or tell you something (the code to the vault is 4532). If you try to give an NPC an irrelevant object they should say "what would i want with that?"
The idea would be that if you type 'unlock [access_point]' on a lock & key system, it will say "what do you want to unlock the [access_point] with?" the way it does now and if you type 'unlock [access_point]' on a keypad system it will just straight away ask you for the code.
You should have the ability to type simply "go n" or "go s" and have the parser recognize it as a valid command to move in the indicated direction.
Can't get this to list the items properly, always with an extra line that looks bad or with "you are currently carrying" shown after the list of items
Example of how it should work:
take letter from box
you can't, the box is closed
open box
the box is open
look in box
the box contains a letter
take money
there's nothing like that here
take letter
taken (and now in inventory)
look in box
the box is empty
close box
you close the box
put letter in box / (put letter back in box should be understood as well)
you can't, the box is closed
open box
the box is open
put letter in box
you put the letter back in the box
look in box
the box contains a letter
Injuries should be specific (broken leg from falling down the stairs, etc.) and deduct a commensurate amount of HP when it happens. If the deduction exceeds or matches your current amount, you die.
There should also be a 'status' command that lists your current injuries. Don't need to make it any more complicated than that.
The part One should get a big push on descriptions and story over the next week to give it a shot at beta testing for some friends.
You should be able to type 'drop [object]' with any item currently in your inventory and it will be removed and added to the items array of the room you're currently in (avatar.location.items)
Few criteria that you'll need to implement here:
If you die you should have the option to enter your initials with your score when you died. Then you can load your game or start over and try to beat that score. Have it look like an old-school arcade game high score list with three initials only for recorded players' scores.
right now as a placeholder it shows the whole contents array of hashes, and if it's empty it shows an empty array.
You could use this simple stopwatch as a basis for adding this functionality to the game (something that was originally included in Zork as well).
This should be put to the test the second you leave the first room
in order to leave you must:
take key
unlock door
go west
otherwise, typing go west will say "sorry, the door is locked"
maybe here it could actually ask the player if they want to try and break it. If they type Y, they will smash through but lose 10HP or something..
This should be easy to add so that whenever you have one in a room, and it's visible i.e. you know it's there and visible: true, you can attempt to punch in a code to unlock the access point.
example:
use keypad
i don't see that here
push bookcase
you give the bookcase a shove, revealing a keypad.
use keypad
your fingers hover above the keys. what's the code, champ?
go east
i'm sorry, that's not a valid code
exit / leave keypad
you decide to take a step back and think for a moment
go east
you head east
go west
you head west (back into the room with the keypad)
use keypad
your fingers hover above the keys. what's the code, champ?
4918
that's... incorrect. you have 4 attempts remaining before a spike falls on your head. [might add this later]
1234
that's... correct! the keypad lights up and a hidden doorway swings open in the eastern wall, allowing you to freely step through, if you like.
If you pick up an object, drop it, pick it up again, then drop it a second time, the game thinks you aren't carrying it. Picking up and dropping is generally buggy but it's close to being done. It almost seems like you have to type the command twice for it to work properly...
Right now it just says 'you've picked up the #{object}" every time which is fine but it would be more atmospheric if it had a special first_time_message (already in the yaml) that appears the first time you pick an object up and never again. After that it can say the basic pickup line.
This should be constantly on display so a player can see whenever they've accomplished something important in the game. Maybe objects should have a point system that gets added to the player's score when they get picked up, and also certain actions and advancements must have an inherent point value that gets tripped when you accomplish them. Zork has the same thing for reference.
Right now if you type 'look closer' when you see the rotting steps outside of the apartment, it says 'you can see a way to safely hop over the stairs'. If you don't use this command, it should have your player fall down through the stairs and either get severely injured or killed.
Need to figure out a way to check if the player has used this command before they proceed downstairs (maybe some sort of 'knowledge' array and then the game checks if you have key pieces of information before you proceed to a new room?).
These will contain important riddles
Certain items are fixed in place in rooms, but may still be important. i.e. door is an object but if you type 'take door' it should say it won't budge. however, you'll need to be able to say 'unlock door' and then change its state to unlocked in the same hash
The unlocked attribute is already in the access points sub-hash, just need to check if the player is carrying a specific key when they type "unlock door" then change unlocked to true.
access points may not need to be open or closed, simply unlocked or locked, to pass successfully through them. open or closed should only apply to containers, but containers can also eventually be locked / unlocked as well.
This way you can eliminate all the checks you have to do in the input_controller for contained items (Hash class) vs. top level items (Item class)
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.