Re: Pointers to Pointers?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Pointers aren't allowed in VB. There are ways to access memory locations
directly, however, using unsafe code and special methods. These aren't
needed very often, however. The only time I've ever had use for them in VB
is when the API calls are just way too slow (like when manipulating
graphics).

What you want sounds more like what Larry proposed - a class that defines
your property values. If you are really against this idea, you can store
the properties as objects in a HashTable or SortedList or something:

Class ShadowSprite
' define properties/methods, etc.
End Class

Class GameObject
Public Settings As New HashTable
End Class

Dim GO As New GameObject
Dim Sp As New ShadowSprite

GO.Settings.Add("ShadowSprite", Sp)

It sounds like you might want to serialize this, so you'll want to keep that
in mind when you create your classes.

"Dave Cousineau ( Sahuagin )"
<DaveCousineauSahuagin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:647B193B-6D60-4807-B245-A74F93744BAC@xxxxxxxxxxxxxxxx
> heres an example:
>
> all physical game objects will have a 'shadow sprite' object reference.
> instead of the user (the user of the game design software not the game
> itself) going to each new game object he creates and selecting a sprite
> for
> the shadow there, he just goes into a settings form, and theres a setting
> for
> 'shadow sprite'. all game objects would now have a 'shadow sprite' member
> that is a reference to a reference, which refers to the reference he
> selected
> under the settings form.
>
> is this taboo or something? its a simple question that seems like it could
> easily be answered by just saying 'no there isnt'.
>
> "Larry Serflaten" wrote:
>
>>
>> "Dave Cousineau ( Sahuagin )"
>> <DaveCousineauSahuagin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
>>
>> > this is for a 2D game graphics engine.
>> > basically i want a list of specific objects under settings that the
>> > game
>> > uses, and that the user is free to reassign.
>> >
>> > ie:
>> >
>> > Shadow Sprite
>> > Fire Sprite
>> > Game Over Sound Effect
>> >
>> > the user will choose a particular sprite or sound effect from the
>> > sprite and
>> > sound effect lists for each item under this settings screen. then the
>> > main
>> > part of the game can simply use 'Game Over Sound Effect' at the
>> > appropriate
>> > time and
>> >
>> > the problem is that i cant save any of these settings values in any
>> > other
>> > object, because if i do it doesnt refer to the settings object, it will
>> > refer
>> > to whatever sprite/sound object the user selected, and then if he
>> > changes it,
>> > it wont have an effect... i want to be able to have a reference to
>> > these
>> > object reference variables, if possible...
>>
>>
>> You lost me at the part about 'then if he changes it'.
>>
>> He selected the effect in the first place, and you are using that, so you
>> have
>> a means to use what the user selects. If he selects another effect he
>> has to
>> be on the settings screen as before, does ne not? Where can he make a
>> change
>> in what he selects other than on the settings screen (which you are
>> already
>> using)?
>>
>> If it were me, I'd create a settings class and let the user alter its
>> property
>> values. Any code that needs to use one of the values gets it from the
>> settings class. If the user changes a value, it goes into effect on next
>> use
>> (because the code calls the same property he just changed....)
>>
>> I just don't see a need for such indirection for user options. As long
>> as
>> you use the same property the users sets, how are you going to get out
>> of sync?
>>
>> LFS
>>


.



Relevant Pages

  • Re: Pointers to Pointers?
    ... > this is for a 2D game graphics engine. ... > Shadow Sprite ... > Game Over Sound Effect ... > sound effect lists for each item under this settings screen. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Unable to load level in Doom3
    ... Random crashes are typically the result of heat, a driver issue or a problem ... There's a 1.1 patch available for DOOM 3 that you might consider trying ... Check your settings in the game - resolution, detail settings, ...
    (microsoft.public.windowsxp.games)
  • Re: Textures all switched around on NOLF 1
    ... I know it's an old game, but I thought my Athlon XP 2100+ WinMe ... texture free. ... I tried changing the system BIOS settings to change AGP to ... and cameras real PITA. ...
    (comp.sys.ibm.pc.games.action)
  • Re: Advice on components for high end PC
    ... hype is going ... Now with newer games, or with top settings in Far Cry, it is ... gig ddr400, and I'm getting ready to up it to 2 gig. ... time the Game writers up their standards, ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: SUCCESS AT LAST
    ... > Dosbox a way to get at the files that are already on your hard drive. ... The scaler settings, such as the advinterp2x, ... The end result is the graphics looking ... I found that changing to advinterp2x did smooth some of the game screens ...
    (comp.sys.ibm.pc.games.adventure)