Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


ApochPiQ

Member Since 17 Jul 2002
Online Last Active Today, 11:20 PM

Posts I've Made

In Topic: Thoughts on Rust?

19 December 2014 - 09:17 PM

Rust is a classic example of what happens when you try to anticipate everything that could ever go wrong, and then build a language feature that tries to make that less dangerous.

"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies." - CAR Hoare.

In Topic: Polymorphic pairwise collision testing implementation

19 December 2014 - 11:51 AM

For even better solutions, look into double dispatch or the more generalized multiple dispatch.

In Topic: declare custom types of ints?

16 December 2014 - 02:45 PM

A common name for this is strong typedef. There are many ways to accomplish this; Brother Bob named a couple, and a quick web search can turn up several more.

In Topic: Alternative to JSON and XML?

15 December 2014 - 01:29 PM

Please don't post in two year old threads.

In Topic: Item Discontinuity Problem

15 December 2014 - 01:03 AM

What is an item?

Usually, it's something like:

- A 3D model
- A 2D icon
- Some stats
- A name and maybe some descriptive text

And that's about it.

All of that stuff is constant, so storing it in an external data file makes sense. It's probably also all unique, so you can assign some kind of identification to it (like, say, a number) and use that as the key in code.

When your item is on the ground, you render the 3D model by looking up the appropriate asset using your item ID key.

When the item is in the player's inventory, you do something similar with the 2D icon.

When equipped, the item probably renders attached to the character in some way, and the stats are likely referenced by your combat system or whatever else.


Not so complicated, really. It sounds to me like you're overanalyzing the problem :-)

PARTNERS