better data structure to handle entity stats
https://github.com/asdru22/Game2D/blob/master/src/main/java/game/stat/Stats.java
i have this class that can store stats like damage, health and speed. each every entity has a local stats variable. i dont like my current implementation since it involves a lot of casting. are there better alternatives?
GitHub
Game2D/src/main/java/game/stat/Stats.java at master · asdru22/Game2D
Java 2d Game. Contribute to asdru22/Game2D development by creating an account on GitHub.
6 Replies
⌛
This post has been reserved for your question.
Hey @asdru! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Hi, can i ask why did you use a map?
Couldn't you just have three variables for health, damage and speed?
i could but i plan on adding more in the future
i guess i could have a class that stores the single stats and add from there but idk
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
I found this tutorial from FreeCodeCamp: https://www.freecodecamp.org/news/code-a-2d-game-engine-using-java/
freeCodeCamp.org
How to Code a 2D Game Engine using Java
If you really want to understand game development, consider coding your own game engine. We just published a 25-hour course on the freeCodeCamp.org YouTube channel that will teach you how to code your own 2D game engine using Java. You will use the g...
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.