Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Objects list : How to use it?
#31
ah yeah that's useful!

I may also have an idea to store more data than expected

I can for exemple use a 10-digits numbers
I can split this number to obtain each digit and store them in an array
And now I can use the first cell to define the speed, the second to define the loot, the third to define how much damage it does, ...
Reply
#32
Yes, that's a way to do it. Integers are 32-bit long, so you have up to 32 bits to encode pieces of separate info.

However I think it may be more manageable if you use type in a simplistic way, and have additional info on game data, not on map data. I mean, that the enemy health and dropped lot depend on enemy type. If you later decide that some kind of enemy needs to have different health or loot type, you just change once in your game data structures. If you've encoded this data in the map, you must change each and every instance of it by hand. That may become tedious and error-prone.
Reply
#33
(12-28-2020, 10:42 PM)megamarc Wrote: Yes, that's a way to do it. Integers are 32-bit long, so you have up to 32 bits to encode pieces of separate info.

However I think it may be more manageable if you use type in a simplistic way, and have additional info on game data, not on map data. I mean, that the enemy health and dropped lot depend on enemy type. If you later decide that some kind of enemy needs to have different health or loot type, you just change once in your game data structures. If you've encoded this data in the map, you must change each and every instance of it by hand. That may become tedious and error-prone.

Yeah that works too, it depends if each instance has to have the same attributes or if you want each instance can have differents attributes
Reply
#34
You'll usually configure those properties at the class/type level, not at each unique instance
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)