Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Sprite System Improvements

Author
Message
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Dec 2003 18:01 Edited at: 2nd Apr 2011 09:39
Question:

I'm build a sprite library ATM, and was looking at adding 'local' user data to the sprites. Currently the idea is to let a user create a 'slab' of data that is associated with the sprite from them on. The idea is so that you can store properties with the sprite. This can be very useful in collision situations for example. I.e. so if you find an collision between sprite 1 and sprite 20. You can read sprite 20's hit point/score/parent array from the sprite..

Anyway, currently i was going to make it so you could just store integer/float values in the user data. So they'd be more like regular properties of the sprite, much like a mini array, but perhaps it'd be better if the user could poke whatever they wanted into them .. ??

Ideas / Input welcome !

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 27th Dec 2003 18:46
All anyone needs to do is create a structure, DIM it, and away you go...

It'll save you the trouble of writing anything...


The place for all great plug-ins
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 27th Dec 2003 22:48
Well the point is to avoid the need of maintaining a UDT array along with your sprites.

Me, I'll sit and write this love song as I all too seldom do
build a little fire this midnight. It's good to be back home with you.
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 27th Dec 2003 23:12
The problem is what is needed would vary according to the type of game. Whilst it would have been better for Lee to add a user-defined data area for all sprites, the best way for users would be to defined the structure themselves and then allocate an array (or memory).


The place for all great plug-ins
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 28th Dec 2003 09:07 Edited at: 2nd Apr 2011 09:39
Sure, you can manually maintain your own parallel data to the sprite system. However building custom (user defined) data into the sprites, just takes away the need to man handle the data.

In the current tech, this ideas is used to simplify resolving collisions between sprites. Currently to resolve collisions, we normally end up comparing our various entities together. These entities are probably stored within various type array/lists. With this approach, the program drives the whole process. If you add different lists of entities, you have to manually wedge in code.

However by storing the user data within the sprite ( hits / score / parent array indexes / pointers), you effectively turn the problem around. No longer do we need to explicitly compare list to list. It can all be resolved from the sprite commands/data without every knowing what parent array a sprite was associated with..

Login to post a reply

Server time is: 2024-11-24 11:51:59
Your offset time is: 2024-11-24 11:51:59