48 lines
1.5 KiB
Plaintext
48 lines
1.5 KiB
Plaintext
How to refer to things
|
|
|
|
====
|
|
MarMOTS: set model?
|
|
when sending a message: send to all in set (useful? or explicit foreach better?)
|
|
when asking a question: ask a random member? if != 1 I think this is almost never what you really want.
|
|
====
|
|
1) construct model:
|
|
all values (except for constants) come from some class of object, of which there are always only small number available to you
|
|
the instance of the class that you query is chosen by narrowing the set by "picking" in the event conditions
|
|
|
|
pros of picking:
|
|
= lets you say when(anything) and have it make sense
|
|
= if there is only one of something you always get it right
|
|
cons:
|
|
= not always an easy way to express what you want
|
|
|
|
2) game maker:
|
|
self, other, pick
|
|
-- gml has the set model!
|
|
other == other involved in collision
|
|
|
|
=============
|
|
namespaces:
|
|
|
|
---------------------------------------------|--------------
|
|
| * System *
|
|
| Thing
|
|
| Whatsit
|
|
| Enemy
|
|
| ...
|
|
| variable?
|
|
|
|
some core stuff should be global (if, expr, true, false)
|
|
I keep forgetting that this kind of interface suggests type inference
|
|
|
|
what is a type? it's
|
|
- number
|
|
- string (ansi)
|
|
- boolean (yes/no)
|
|
- object<|x,y,z|>
|
|
- with mixins x, y, z
|
|
object<|x|> is a subtype of object<|x,y|>
|
|
- list<t>
|
|
- void
|
|
- t
|
|
|