-
Notifications
You must be signed in to change notification settings - Fork 4
Other Related Coder for Obstacles
Unlimited generation
Rendering order
Sound
All functions in ForestGameArea.java that require endless generation will be called by render()
in MainGameScreen.java.
This judging function is written in render()
by the members of team6 to generate endless terrain. Thank them very much for their efforts, and we have used their logic to achieve the function of endless generation
// Centralize the screen to player
Vector2 screenVector = player.getPosition();
screenVector.y = 7f;
renderer.getCamera().getEntity().setPosition(screenVector);
// infinite loop for terrain and obstacles
if (screenVector.x > (2 * counter + 1) * 10) {
counter += 1;
forestGameArea.showScrollingBackground(counter);
forestGameArea.spawnTerrainRandomly((int) (screenVector.x + 2));
// Generate obstacles
forestGameArea.spawnObstacles();
// Generate meteorites
forestGameArea.spawnMeteorites(0, 1, 2, 1, 1, 2);
// Generate enemies
forestGameArea.spawnFlyingMonkey();
}
When an entity needs to be generated on top of other entities, the engine's rendering order for these entities needs to be adjusted.
For example, this rendering sequence can solve the bug of thorns below the ground.
In entity.java, the zIndex
of entity can be determined by setting the following function.The larger the zIndex
, the lower the rendering order.
public void setZIndex(int zIndex)
zIndex
works in RenderComponent.java.
/**
* Set the zIndex of the entity according to the y coordinate of the entity and the original zIndex.
*
* If zIndex is not set originally, then The smaller the Y value, the higher the Z index, so that closer entities
* are drawn in front.
*
* If zIndex has been set, zIndex will not change.
*
* @return The drawing priority of the current entity
*/
@Override
public float getZIndex() {
// The smaller the Y value, the higher the Z index, so that closer entities are drawn in front
if (this.getEntity().getZIndex() == 0) {
return -entity.getPosition().y;
} else {
return entity.getZIndex();
}
SoundComponent.java When creating an entity, you can add a sound component to it. This component is used to add different listeners according to different entity types. This separates sound from other functions, which is conducive to tests and a more optimized code structure.
public void create() {
switch (obstacleType) {
case Spaceship:
entity.getEvents().addListener("spaceshipSound", this::spaceshipSound);
break;
case SmallMissile:
entity.getEvents().addListener("missileSound", this::missileSound);
break;
case FlyingMonkey:
entity.getEvents().addListener("roarSound", this::roarSound);
break;
default:
logger.debug("No corresponding sound.");
}
}
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