Mobs

From Whirled Club Wiki
Revision as of 13:23, 26 August 2018 by Dragawn (talk | contribs) (Created page with "'''Mobs''' are display objects used in an AVRG that move around a room in the room's 3D coordinate space. For example, a mob can fly behind a piece of furniture or cli...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Mobs are display objects used in an AVRG that move around a room in the room's 3D coordinate space. For example, a mob can fly behind a piece of furniture or clip through player avatars.

Here are a couple of sample mobs from the test environment AVRG Probe. They are both positioned on the floor (y=0). Mob M1 is at about Z=0.4 and M2 is at about Z=0.6. The avatar is at Z=0.5, covers up M2 and is covered by M1.

MobClipping.png

The server agent can perform three actions on mobs:

  • spawn
  • despawn
  • moveTo

A server agent cannot create DisplayObject instances, so in order to display them clients must register a function with the API that will create a mob using the name given by the server agent (setMobSpriteExporter()).

When a player enters a new room or when the server agent spawns a mob in the player's current room, all mobs that are currently spawned in that room will be created using the exporter. Therefore, if a mob sprite is handling any events, it should be sure and remove itself from all processing on REMOVE.

Besides game specific behavior, clients can set the hot spot of a mob, which will control its placement and give the mob a decoration which appears above it.