-
Notifications
You must be signed in to change notification settings - Fork 4
Portals and Worlds Code
All portals are an instance of the Abstract portal class. Portals are created by calling, for example
GameManager.get().getWorld().addEntity(new AbstractPortal(14, 17, 0, "Desert World"));
where the arguments of the method are for int: posx, int: posy, int: posz, String: texture
.
The base portal extends this class as its functionality also includes being mortal (i.e. it can take damage) and having a health bar displayed as a progress bar. To instantiate a base portal, therefore you need to call:
GameManager.get().getWorld().addEntity(new BasePortal(14, 17, 0, 100));
where the arguments of the method are for int: posx, int: posy, int: posz, int: maxHealth
. (Note that the texture for the base portal does not need to be specified)
The plater can be transported to a new world by calling
GameManager.get().getWorld().removeEntity(player); GameManager.get().getManager(WorldManager.class).setWorld(world); GameManager.get().getWorld().addEntity(player);
See below for a UML diagram of these classes:
- 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