Object Oriented Programming in BooBoo Tutorial
Topic: BooBoo
Basically containers (vectors and maps) are untyped until assigned (and types can also be reassigned). So you can do things like:
function my_ship_movement a b c d {
...
}
function my_ufo_movement a b c d {
...
}
vector entities
map m
; construct ship...
map_clear m
= [m "movement"] my_ship_movement
= [m "draw"] ...
...
vector_add entities m
; construct ufo
map_clear m
= [m "movement"] my_ufo_movement
...
vector_add entities m
function move_entities a b c d {
number sz i
vector_size entities sz
for i 0 (< i sz) 1 loop
call [[entities i] "movement"] a b c d
:loop
}
...
Replies
No replies have been posted.