You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Separate the code in events and responses. Designers can then match the events with the desired amount of responses.
In Pong:
Events:
Tick: ...
Overlap: a @ overlaps(b)
Wiring:
Tick: Control
Overlap: Respawn, Serve, Score, Restart
Possible improvement:
While wiring events to responses, entity names can overlap. For example, A and B appear both in the Overlap event as well as in the Respawn response. By default, these are assumed to be the same entity. In this case, in order to Overlap+Respawn to run, a must have position and a collider and b must have respawnPosition and a collider.
This limits the naming capabilities. It should be possible to wire the names if wanted.
For example,
Overlap: Respawn(a=a,b=b), Serve, Score(a=c), Restart
Here, the linking is made explicit in respawn, still implicit with the same effect in serve. In score, c must be an a, and in restart, c is independent from a and b.
The text was updated successfully, but these errors were encountered:
Separate the code in events and responses. Designers can then match the events with the desired amount of responses.
In Pong:
Events:
Tick: ...
Overlap: a @ overlaps(b)
Responses:
Respawn: a.position = b.respawnPosition
Serve: a.velocity = random(a.serveVelocity)
Score: foreach c { c.score += a.worth }
Restart: foreach c { if c.score > c.max { c.score = c.reset } }
Control: foreach a { a.velocity = a.direction * readNumber(a.controlInput) }
Wiring:
Tick: Control
Overlap: Respawn, Serve, Score, Restart
Possible improvement:
While wiring events to responses, entity names can overlap. For example, A and B appear both in the Overlap event as well as in the Respawn response. By default, these are assumed to be the same entity. In this case, in order to Overlap+Respawn to run, a must have position and a collider and b must have respawnPosition and a collider.
This limits the naming capabilities. It should be possible to wire the names if wanted.
For example,
Overlap: Respawn(a=a,b=b), Serve, Score(a=c), Restart
Here, the linking is made explicit in respawn, still implicit with the same effect in serve. In score, c must be an a, and in restart, c is independent from a and b.
The text was updated successfully, but these errors were encountered: