Re: Structs

new topic     » goto parent     » topic index » view thread      » older message » newer message

Things like this are often necessary and useful. So the dot notation shouldn't really stop at a single level:

point = {integer x, integer y) 
 
critter.position = point 
 
critter.position.x = 10 
critter.position.y = 20 
 
critter.position = {20,20} 
 
critter.position += {50,40} 
 
critter.path = repeat(critter.position,10) -- i.e. an array in which you could store the last 10 locations 
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu