forums

TNT Basic Forums > Feedback
Structured Types
< Last Thread     Next Thread >
Author
Thread        Post A Reply

12-29-2003 16:10

Posted by:
nelefa

Location:
Edinburgh

Click Here to Email nelefa   Find more posts by nelefa

Structured types would be very yummy. I mean something that can be defined in a way similar to the following pseudocode:

Type spaceShip
int spriteID
int sprite
int x
int y
int speed
int rotate
End Type

A new "spaceShip" type could be created by doing something like:

myShip = new spaceShip
myShip.spriteID=<blah>
myShip.sprite=BIG_BLUE_SHIP
myShip.x = 120
myShip.y = 150
myShip.speed = VERY_QUICK
myShip.rotate = 90

Then, the good bit comes - we have a varying number of enemy ships in existence at any one time. Wouldn't it be nice if we could iterate through them all to update them by doing:

currentShip = each spaceShip
if currentship.<some var> = <some condition>
delete myShip currentship
else
<do some stuff>


Does any of that make sense to anyone except me? Basically what I'm hoping for is something a little like C's typedef struct routine with a linked list hanging off the back of it :)

Cheers

J (newbie)

01-01-2004 19:47

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

I have something very similar planned for a future version of TNT Basic, but it's not going to happen any time soon unfortunately.

Mark

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.