A tank with 5 turrets (types)

Blitz3D Forums/Blitz3D Programming/A tank with 5 turrets (types)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

mpausi: Yes, it is possible to make things more flexible - a couple of methods spring to mind. Sorry, but I'm in a bit of a rush at the mo but I'll try and get back with some code soon. Of course, anyone else is free to post their own methods in the meantime. :)

Slenkar: Not sure why you would need to contain everything in a single type but I guess you have your reasons. Given that restriction, the only why to achieve this is to 'hardcode' the various fields into a single type, like:

Type tankType
	tankName$
        turret1_rot#
        turret1_ele#
        turret2_rot#
        turret2_ele#
        turret3_rot#
        turret3_ele#
        turret4_rot#
        turret4_ele#
        turret5_rot#
        turret5_ele#
End Type


However, this is alot less flexible than using the array method as you can probably imagine. Actually, there are other ways like using a bank to hold the various turret properties and using peek/poke to read/write them, but this makes things unnecessarily complicated, IMO.

Nacra: You're more than welcome! ;)