I couldn't get those screenshots to load unfortunately, but I have copied the code to my computer. That way can put it in an easier to read editor.
Do I have to sign up for that repo to edit the code? Either way I'm messing around with it. I haven't done anything technical really, but I have corrected some typos and misspellings in outputs in my copy.
I'm trying to wrap my head around the program flow. I get that you click start then setup the location, class, et cetera. Once you're at the part where you can click the directions or wait button I'm a little lost though.
Nothing much really seems to happen whatever buttons I press, aside from the movement direction or waiting messages.
I see a number changing below the name as the buttons are pressed, what does this represent? Is that the tally stuff you're talking about?
Maybe if you're up for it give me an overview of what you're looking at in terms of a game loop. I see a lot of random number generation in your code, is it meant to start some sort of encounter with a random monster every so many steps (presses of the direction buttons)? I might be way off base there.
It seems pretty early, but I imagine you have some idea of how you want it to work.
Okay, thank you for getting involved. I do think you have to sign up with codepen to fork & edit pens.
The numbers that change below the name is the tally & tallyMark numbers, when the game gets done or the conditional statements start working the user will not be able to see the tally numbers. So the game is going to be mostly event based by the tally or tallyMark numbers. For example, their would be specific events at certain number marks and possible events when players are in certain ranges. For example, I want to the first monster event to happen at tallyMark 12. The users action keys would change to a fight key set (not yet coded). The value assigned to the objects like the weapons or armor will give its "ability score" so a stick's weapon value is 1 and an boar's value is one, so the user would only have to hit the boar once to kill it. Same goes for armor (armorValue would be equal to its defense points), spells (spell Value would be equal to its duration time), etc etc etc.
An example of the tally range would be like, if the first town is to appear when the player tallyMark hits the 20-30 range. So it wouldn't be every time at a certain point but more random so players get that random aspect. Also the difficulty is a unique thing I'm trying where, if a player's tallyMark hits 100 the player will be bumped up to easyHard instead of just easy but at the same time for example let's say the player is under 100 tallyMark points, in the 1st town and is on easyPick but they run to the castle to enter the castle's keep, the difficulty will automatically bump up to easyHardPick, making it less likely the player will succeed without stuff. So the difficulty will have fixed increase and a flow-difficulty so it may go up or down depending on where the player is.
So that's much of the mechanics some still not coded yet but the game I want to be mostly a text adventure but with some interface. The moving keys is a great example but there's also stats (#/#/#/#/#), mana, health and an inventory. So say the player is in a battle, instead of a button that says equip, the user would just click the weapon to equip then the "attack" button would become usable and then they can use it or click on a potion to use a potion. I don't want the fights to be turn based but time based so if a player just sat and didn't do anything, the monster/enemy would keep attacking every x-number of seconds. The time between attacks for random drop enemies would be based on the monsterValue and the time for pre-determined enemies would be based on their monsterValue but in ranges. For example, in the castle's dungeon their could be a dragon placed and its monsterValue is 12 so, it would attack between x times 1-seconds & x times 12-seconds giving opportunities like quick time between attacks and long time between attacks. Also I want to set in attacks that give illusions of like double attacks or sweeping attacks and so forth.
Since you are helping, I will want to place your name/preferred username & finding location (github, codepen or a social media location) in the credits (also not yet coded). You can contact me on Twitter (Twitter.com/Radioactive3D) or ReBuzz app (I'm @ddd on Rebuzz) or just continue contacting me here through Hive. Thank you again and I appreciate your assistance.
Just a heads up, I've done more coding since I originally posted this and have included more data there so you may want to check the codepen again https://codepen.io/digimancer3d/pen/QWjKQeR.
I took a deeper look at the code, and reread you comments here. I'm fairly sure I understand the direction you're going, and I think I can make it happen with the tallyMark counter concept with some changes to your code. I don't have much more time right now, but I'll get to work on it soon.
Unfortunately I cannot sign up. It's giving me an error when I try to.
I don't use any other social media than this, so I will contact you through Hive.
Thank you for the diversion. It's something to do while I'm cooped up at home.
Thank you for helping, I'll be here and we can anyways swap code here as well. Thank you.
Great news, I've been able to make an account and fork your code.
Before you work much more on it, take look at my codepen.
I made it so that a different output is made when tallyMark is greater than 12. Checking the value of tallyMark works now, and it should be fairly ready for you to implement more.
Most of the work I did was on readability, but like I said I corrected some typos in outputs as well.
In the work I did I noticed quite a few redundancies in your code. I'm willing to help optimize and shorten your code, but I'm done working on it for right now. I'll likely come back to it tomorrow and do more.
The first thing that jumps out at me (in terms of things to improve) is that there are 5 separate sets of movement buttons. It seems to me that this is unnecessary, and I'm sure I can make it so that you can use just one set in all different contexts.
I also left various comments, so check those out as well.
It's refreshing to be working on something so whimsical and not serious, and I'm having fun with it.
I spent all the time I would've been curating today doing this instead!
I was looking through your code and I didn't know I could put use javascript to handle the commands I was using the onClick for. To be honest, I've only been learning js as a hobby so I really appreciate every input you can give me. JS is way different than C++, lol which is the only coding language I've ever learned from a school (high school). The sections with 'tallyMark += #;' for example, I tried that and it didn't work the first time so I switched to the redundant sections of just ++ adding into tallyMark. I really appreciate the help and I hope you continue to help me out as this keeps going. I'm adding in more code and I was curious since you have the tallyMark += #; could I remove the redundant adding into the tallyMark with ++, and removing tallyMark with --?
If you watch lbry, I had posted some videos on there my first day and two about the strange problems I was having, if you wanna have a bit of a laugh. lol
I hope you are feeling better today and keep pushing forward with your health. <3 <3 <3
Sorry, I don't watch lbry. I've never even heard of it honestly.
"JS is way different than C++..."
You've got that right. I prefer a strongly typed, compiled language myself. I really like C++. The first language I learned in secondary school was Visual BASIC, followed by C, then on to C++, and Java. After that I had to learn python to start in college and then a bit of JavaScript to make a WebGL graphics engine for an assignment.
"I really appreciate the help and I hope you continue to help me out as this keeps going."
Glad to hear it.
I plan on keeping up. In fact I've been rolling over a few ideas in my mind today. I'll likely check it after writing this, but once you make the next chunk and put it in the repo let me know. I'm going to fork that and make some changes. I'll put it back up on my repo when I'm done, and we can simply keep passing it back and forth building and improving.
"...I tried that and it didn't work..."
JS is not my best language, but I'm pretty sure it was a scope problem. My best guess is that tallyMark was declared in the scope of the JS script element, but you were calling it from the scope of the button element's onclick attribute. Javascript would silently allow you to implicitly declare the value as you use it. Thus you had two (or more because of multiple button onclick usages) tallyMark variables; one in the script element's scope, and one in the individual button element's scope. At least that's the theory that led me to my solution, it might not actually work like that. JS is probably my least favorite language of those that I know.
Still I'll offer my skills to this game.
I've been hitting a snag with my main software project these days. I need to know some of the finer points of how Hive transactions work (since I want to make my own Hive library in Java), but I'm having trouble finding help and information.
This work will help keep my mind fresh and give me some much needed JavaScript practice.
I just finished looking over your code, and it isn't working past clicking the start button.
I presume that's because it's being actively developed, so I'm going to wait a bit for you to finish before doing any more major changes.
I spent the time I set aside to work on this finding where the syntax error I see in the console is. Removing line 822 (fourth line of learnFight function) allows the user to get past the press start screen.
I'll check back later and hopefully things will be more stable once you're done.
Lots of luck.
Hey non-e-moose, sorry it took me so long to get stuff added into the game. I didn't get to the lore but I added in a townSections and towns. I tried to fix that fighting error. I added in hopefully a difficulty check and monster check but unsure if I did it right. I added in comments to respond to some of your comments & i'm thinking if the difficulty check gets working, then the controls could be streamlined (like you said could most likely be done) to just one set. I added in some way to find player health and mana. I started to add in the fighting functions but got a bit stumped. Thank you again and I hope you are feeling better.
Awe, I was wondering where that issue was. Okay kool, I'll get back on it tonight. I like the passing back and forth idea you mentioned on the other comment. Feel free to add in extra content and such or to rewrite anything you feel is needed. I am going to add in the towns and town setups as well as some lore.
Your history into coding is very extensive. I only took C++ in high school and learned a bit of basic and early python just before that. I never took college courses, I didn't exactly have the grades to get in. Lol
As for the hive info, I will look around and see if I can find some info to help you. The Java hive library sounds pretty kool.
Ttyl, happy coding!
Thank you greatly, I will look into your version and comments. I too was wondering if we defined the difficulty as it's own value if we could drop the movements down to a single set. I too added more in yesterday and I'm looking at your code today. Thank you greatly for spending time on this. You will be in the credits.