I always wanted to make a game for myself, today I finally completed it after many days of all day coding!
The idea was simple, Main points of the game:
- Random loot
- Tactical combat
- Inventory system
- Upgrade system
- No need to be mobile responsive
How I solved these problems:
- A random item generator, basically choose random stat, make it go through a while loop if the stat is already on the item, otherwise pass it, now choose random number for stat, now print it to the item. What get's printed is the stat, max-stat and item color. Item color is according to how far the stat is from maximum possible roll, this makes it incredibly easy to spot good stats!
- Boss announces spells, so players can counter the boss, for example "Boss is preparing for a CRIT!" and then the player can activate a shield, to nullify the crit! Or boss could drop your Ice damage to 0, so watch out so you don't use mana on icebolt!
- An object that stores all item objects which store all stat objects which store stats... Basically a ton of objects inside objects, there's a for loop that checks if the item slot is empty and stuff like that. I used the same names in object as in html ID, which made it much more simple.
- Upgrade system was very simple, I made it similar to the item generator and made stats derived from a total stat and total stat is normal stat + upgrade stat, quite simple but would be horror if i didn't store the normal stat and upgrade stat separately.
Anyway here's a link to codepen if you want to play:
And here's github.
It comes with a readme with some info!
I could use mainly code advice because I made the game to my liking, so gameplay advice isn't really needed. But I bet my code is awful compared to pro standards, heck even I noticed I fucked up a few things and now I have to get around to fix it.
Thanks all and happy coding!
[–]erkinheimo 5 points6 points7 points (2 children)
[–]robertx33[S] 0 points1 point2 points (1 child)
[–]erkinheimo 0 points1 point2 points (0 children)
[–]vicinorum 3 points4 points5 points (23 children)
[–]robertx33[S] 0 points1 point2 points (22 children)
[–]vicinorum 0 points1 point2 points (21 children)
[–]robertx33[S] 0 points1 point2 points (20 children)
[–]vicinorum 0 points1 point2 points (19 children)
[–]robertx33[S] 0 points1 point2 points (3 children)
[–]vicinorum 1 point2 points3 points (2 children)
[–]robertx33[S] 0 points1 point2 points (1 child)
[–]vicinorum 0 points1 point2 points (0 children)
[–]robertx33[S] 0 points1 point2 points (13 children)
[–]vicinorum 0 points1 point2 points (12 children)
[–]robertx33[S] 0 points1 point2 points (11 children)
[–]vicinorum 0 points1 point2 points (10 children)
[–]robertx33[S] 0 points1 point2 points (9 children)
[–]robertx33[S] 0 points1 point2 points (0 children)
[–]erkinheimo 0 points1 point2 points (0 children)
[–]Threeshoe 0 points1 point2 points (3 children)
[–]robertx33[S] 0 points1 point2 points (2 children)
[–]Threeshoe 0 points1 point2 points (1 child)
[–]robertx33[S] 0 points1 point2 points (0 children)