-
Notifications
You must be signed in to change notification settings - Fork 4
TimeEvent
Adam White edited this page Aug 27, 2017
·
6 revisions
Time events are events that happen after a certain amount of time (all times are in milliseconds). We have included various timer functions that can be used for many aspects of the game. For instance, a timer event that begins when the character builds a tower, tower upgrade times etc. TimeEvents must be registered with the EventManager to work
New time events are created by extending the TimeEvent class.
The method action
needs to be implemented for subclasses
Any concrete time events will also need to set the progress, reset and reset amount as necessary.
Note that if a tick is larger than the reset amount the action may be called more than once (catchup if a tick is slow)
Method | Use |
---|---|
action(T param) |
The action that is run when the event finishes or resets |
setProgress(int progress) |
Sets time left till the event finishes |
setDoReset(boolean doReset) |
Whether the event will reset to the reset amount when it finishes |
setResetAmount(int resetAmount) |
The amount the event will reset to |
reset() |
Sets the progress to the reset amount, or 0 if it will not reset |
decreaseProgress(long deltaTime, T param) |
Used to reduce the progress of the event by an amount of time. The param is supplied to the action, if it executes |
- Home
- How To Play
- Keybindings
- Inventory and Resources
- Trees
- Portals and Worlds
- Projectiles
- Enemies
- Waves & Spawning
- Graphical assets progress overview
- Audio Files
- Design Templates
- Blender Intro
- Converting 3D models to Sprites
- Scripting in Blender
- Creating a Model in Sketchup
- Colouring and Animating in Blender
- Animation using Dope Sheet, Keyframes and Scale Transformation in Blender
- Template
- Testing
- Terrain
- Terrain Generation
- Resource Trees
- Main Menu, Chat, options
- Main Menu V2, Options V2, Sound
- Damage Trees
- Projectiles
- Enemy User Testing
- Tree planting, inventory GUI, resources, portals
- Caveman Character
- Debug Mode Menu
- Tree learning, Attack Trees, Main Menu Tutorial Resources Styling
- Revamped Resource Trees
- Squirrel User Testing
- Final evaluation
- Project Structure
- Git Workflow
- GUI
- Worlds
- Entity Directions
- Resources
- Inventory
- AbstractEntities
- BasicProperties
- MortalEntity
- ProgressBarEntity
- Multiplayer
- Trees
- TimeEvent
- Game Time
- Animations
- Enemies
- Waves
- Player
- Projectiles
- Effect
- Particles
- Path Manager
- Sounds
- Debug 'God' Mode
- 2D Collision
- Box3D {depreciated}
- Render3D
- Cheat Codes