COMP 310
Spring 2017
|
Command-dispatching
Ballworld with Inter-ball Interactions
|
|
The demo should appear on your screen in its own window. To
restart the demo, refresh/reload this page.
Note: it is
an Honor Code violation to attempt to decompile any supplied code
The following different types of strategies are available for use:
- Straight
- Curve
- Color
- Breathing
- Wander
- Drunken
- Change1
- Change2
- Friction -- slows the ball down by 20% each update.
- Strategies that both collide and interact:
- Collide -- elastic collision behavior. Uses nudging
for rebound positioning.
- CollideExact -- elastic collision behavior. Uses
exact calculations for rebound positioning.
- Spawn -- adds an identical ball whenever it overlaps with
another ball.
- HitFlash -- flashes red color when overlaps with another
ball.
- Infect -- a black-colored ball that will turn any other
ball it overlaps with into an Infect ball for its first 50 updates.
After that, the ball becomes a normal Straight ball.
- Strategies that just detect an interaction and invoke the
interaction strategies of the interacting balls.
- Overlap -- Detects if the ball overlaps with any
other balls.
- Strategies that only install interaction strategies and
thus at least be combined with a strategy that detects an interaction, e.g.
Overlap or Collide.
- Kill -- deletes other when it collides.
- Eat -- kills whomever the ball collides with and
increases its area by the killed ball's area.
- Collide2 -- elastic collision implemented purely as
an interaction strategy. Combine with Overlap to see
bouncing balls.
The following paint strategies are available for use:
- Ball
- Square
- Rectangle
- Ellipse
- Fish1
- Fish2
- SwimFish
- NiceFish
- SoccerImage
- PlanetImage
- SharkImage
- BirdSheepImage
- MarioSonicImage
Questions: What happens when you make balls that
have an interaction strategy but no interaction detection?
What happens when you add a ball that does have interaction detection?
© 2017 by Stephen Wong