Wallrider/Items
From GDWiki
Items will be represented by spinning 3D models in the Arena, and can be picked up by a single Car. When it's picked up, it will display an icon on the user's screen.
Pickups
Items can be dropped in specific, strategic locations defined by the arena, or they will otherwise just be randomly dropped. A few possible items could be:
- Speed booster - increases speed of the car
- Missile - blows up an opponent car, sending it flying into another wall
- Clone - creates a separate AI car for limited time to fool opponent
- Paralyze - stuns opponent for a small length of time
- Wall - creates a Light-Cycle-like wall hazard behind the player for a short distance
Modifiers
After picking up an item, whatever Modifiers you picked up or pick up after the item will be applied to it. These also appear as icons on your screen, and they are only temporary. You can have more than one modifier at a time.
- Homing
- 2x Power - doubles the important stat of the item (time, or damage)
- Speed - Increases the speed of the pickup (ex. missiles would be faster)
Implementation
At the time of writing, the items were implemented as such: There is a base class, called CPickup, which extends IDrawable and which houses the one mandatory function for all items, the applyPickup() method, which will give the car the abilities from whatever pickup or modifier it hold, as well as defining several static constants to be used to identify pickups and modifiers in case we ever need to. Each CPickup also has a myPickup and a myModifier; one of these should always be set to -1, and this one will be ignored.
After finishing the CPickup, a small class, I began on the CSpawningPickup, which defines the functions inherited from IDrawable (Load Step and Draw) and also has a respawnTime and a timer so that once you get the pickup it will respawn in a given amount of time. In the constructor you can pass it an ISection which it will spawn at the getX() getY() getZ() of (and dont worry, there is a CRandomlySpawningPickup which spawns at a random place on the give ISection). Also you can pass the CSpawningPickup values for its pickup and modifier, but if you don't it will simply randomly choose.
