-
Notifications
You must be signed in to change notification settings - Fork 4
Spaceship Boss Code
Creation
ββCreate Spaceship
ββCreate Missile
ββCreate Portal
Difficulty of attack
The code for creating spaceship and missile is in NPCFactory.java.
Unlike other enemies, the spaceship adds a SpaceshipAttackController
. This component will be mentioned later.
The missile entity contains two animations, and one of them will be played when it is created. Since the original missile image has a large transparent part, this part should not trigger the collision effect. The code to adjust the collision edge is as followsοΌ
Vector2 boundingBox = missile.getScale().cpy().scl(0.5f, 0.3f);
missile.getComponent(HitboxComponent.class).setAsBoxAligned(
boundingBox, PhysicsComponent.AlignX.LEFT, PhysicsComponent.AlignY.CENTER);
For aesthetics, missiles are better generated above spaceship. This is achieved by adjusting zIndex
. The engine first draws zIndex
smaller entity. Corresponding code.
missile.setZIndex(1); // Generate missile above spaceship
createPortal(Entity target, ObstacleEventHandler.ObstacleType type)
in ObstacleFactory.java realizes the function of creating a portal.
ObstacleEventHandler.ObstacleType type
is used to specify the type of the portal to determine the event that the entity should listen to. The type on should be PortalEntrance
or PortalExport
. They respectively teleport the player to different locations. The animation starts when the portal is spawned.
This part of the function is mainly realized by SpaceshipAttackController.java. This component completes the function of character movement and trigger generation of the missile. The related camera movement is implemented in MainGameScreen.java. This defines the type of spacecraft attack, the spacecraft attack state and the remaining time of the attack.
/**
* Spaceship attack state
*/
public enum SpaceshipAttack {
Off,
Start, // Used once in render
On,
Finish;
}
/**
* Spaceship attack type
*/
public enum AttackType {
Low,
Middle,
High,
Player;
/* Spaceship attack time */
public float spaceshipTime;
When the character collides with the spaceship, change the attack state of the spaceship to Start
. Every time reder()
, judge the spacecraft's attack status and remaining time. That is, when the attack starts, other tasks are automatically performed by this component.
This part of the code is implemented in easyAttack()
and hardAttack()
respectively. These two functions determine how long to generate the frequency and number of missiles. They are called by spaceshipAttackScene()
. Each time the game render()
, determine which type (easy, hard) of attack should be executed according to the current remaining time.
The following function determines where the missile is generated.
private Vector2 getRandomPosition(Vector2 spaceshipPosition, Vector2 playerPosition, AttackType type, int level)
According to different AttackType
, the generated position is different. There are a total of four location options. High
, Middle
, and Low
are to generate a missile at a fixed position, and the Player
type generates a missile according to the current height of the player.
Camera Angle and The Player's Perspective
Achievements Trophies and Cards
πΎ Obstacle/Enemy
βMonster Manual
βObstacles/Enemies
ββ- Alien Plants
ββ- Variation thorns
ββ- Falling Meteorites
ββ- FaceHugger
ββ- AlienMonkey
βSpaceship & Map Entry
βParticle effect
[code for debuff animations](code for debuff animations)
Main Character Movement, Interactions and Animations - Code Guidelines
ItemBar & Recycle system
πΎ Obstacle/Enemy
βObstacle/Enemy
βMonster Manual
βSpaceship Boss
βParticle effects
βOther Related Code
βUML & Sequence diagram of enemies/obstacles
Scoring System Implementation Explanation
Buff and Debuff Implementation
Infinite generating terrains Implementation Explanation
Game Over Screen and functions explaination
Buffer timer before game start
Rocks and woods layout optimization
Magma and nails code implementation
Guide: Adding Background music for a particular screen
History Scoreboard - Score Details
Listening for important events in the Achievements ecosystem
Hunger and Thirst icon code guidelines
Hunger and Thirst User Testing
Buff and Debuff Manual User Testing
The New Button User Test in Setting Page
The Main Menu Buttons User Testing
Infinite loop game and Terrain Testing
https://github.com/UQdeco2800/2021-ext-studio-2.wiki.git
πΎ Obstacle/Enemy
βObstacle testing
ββ- Alien Plants & Variation Thorns
ββ- Falling Meteorites
βEnemy testing
ββ- Alien Monkeys & Facehugger
ββ- Spaceship Boss
βMonster Manual
βParticle-effect
βPlayer attack testing
ββ- Player Attack
Sprint 1
Sprint 2
Sprint 3
Sprint 4
Changeable background & Buffer time testing
Game over screen test sprint 4
New terrain textures on bonus map test sprint 4
Achievements System, Game Records and Unlockable Chapters
Musics Implementation Testing plan