Skip to content

Commit

Permalink
fixed merge coflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
gregchan550 committed Sep 28, 2023
2 parents a24c884 + 99a5e3d commit 0483b8a
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 38 deletions.
18 changes: 6 additions & 12 deletions source/core/src/main/com/csse3200/game/areas/ForestGameArea.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
package com.csse3200.game.areas;

import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.GridPoint2;
import com.badlogic.gdx.math.Vector2;
import com.csse3200.game.components.ProjectileEffects;
import com.csse3200.game.areas.terrain.TerrainFactory;
import com.csse3200.game.areas.terrain.TerrainFactory.TerrainType;
import com.csse3200.game.components.TouchAttackComponent;
import com.csse3200.game.components.ProjectileEffects;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.factories.*;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.components.HitboxComponent;
import com.csse3200.game.utils.math.RandomUtils;
import com.csse3200.game.services.ResourceService;
import com.csse3200.game.services.ServiceLocator;
import com.csse3200.game.components.gamearea.GameAreaDisplay;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Random;
Expand Down Expand Up @@ -567,7 +561,7 @@ private void spawnFireWorm() {
}

private void spawnSkeleton() {
int[] pickedLanes = new Random().ints(1, 7)
int[] pickedLanes = random.ints(1, 7)
.distinct().limit(5).toArray();
for (int i = 0; i < NUM_GRUNTS; i++) {
GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]);
Expand All @@ -589,7 +583,7 @@ private void spawnDragonKnight() {
}

private void spawnWizard() {
int[] pickedLanes = new Random().ints(1, 7)
int[] pickedLanes = random.ints(1, 7)
.distinct().limit(5).toArray();
for (int i = 0; i < NUM_GRUNTS; i++) {
GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]);
Expand All @@ -600,7 +594,7 @@ private void spawnWizard() {
}

private void spawnWaterQueen() {
int[] pickedLanes = new Random().ints(1, 7)
int[] pickedLanes = random.ints(1, 7)
.distinct().limit(5).toArray();
for (int i = 0; i < NUM_GRUNTS; i++) {
GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]);
Expand All @@ -611,7 +605,7 @@ private void spawnWaterQueen() {
}

private void spawnWaterSlime() {
int[] pickedLanes = new Random().ints(1, 7)
int[] pickedLanes = random.ints(1, 7)
.distinct().limit(5).toArray();
for (int i = 0; i < NUM_GRUNTS; i++) {
GridPoint2 randomPos = new GridPoint2(19, pickedLanes[i]);
Expand Down Expand Up @@ -708,7 +702,7 @@ private void spawnRicochetFireball(Vector2 position, short targetLayer, int dire
*
* @param position The position of the Entity that's shooting the projectile.
* @param targetLayer The enemy layer of the "shooter".
* @param direction The direction the projectile should head towards.
* @param direction The direction the projectile should towards.
* @param speed The speed of the projectiles.
* @param amount The amount of projectiles appearing after collision.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private void onCollisionEnd(Fixture me, Fixture other) {
// * RIGHT NOW TARGET IS NPC, SUBJECT TO CHANGE
// Speed is a bit faster than normal but can change.
Entity newProjectile = ProjectileFactory.createFireworks(PhysicsLayer.NPC,
new Vector2(100, (float) (projectile.getPosition().y + (newDirection - (TOTAL_RANGE/2)))), new Vector2(3f, 3f));
new Vector2(100, (float) (projectile.getPosition().y + (newDirection - (double) (TOTAL_RANGE/2)))), new Vector2(3f, 3f));

newProjectile.setPosition(newXPosition, (float) projectile.getPosition().y);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void onDeath() {
// Inspired by:
// https://stackoverflow.com/questions/37145768/distribute-points-evenly-on-circle-circumference-in-quadrants-i-and-iv-only
for (int i = 0; i < amount; i++) {
float currAngle = (360 / amount) * i;
float currAngle = (float) (360 / amount) * i;
double radians = currAngle * Math.PI / 180;

float newX = entity.getPosition().x + (float) OFFSET_DISTANCE *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import com.csse3200.game.ai.tasks.DefaultTask;
import com.csse3200.game.ai.tasks.PriorityTask;
import com.csse3200.game.components.TouchAttackComponent;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.Melee;
import com.csse3200.game.entities.Weapon;
import com.csse3200.game.entities.factories.ProjectileFactory;
import com.csse3200.game.physics.PhysicsEngine;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.components.HitboxComponent;
Expand All @@ -17,7 +15,6 @@
import com.csse3200.game.services.GameTime;
import com.csse3200.game.services.ServiceLocator;


/**
* Task that allows mobs to shoot projectiles or melee attack towers
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import com.csse3200.game.ai.tasks.DefaultTask;
import com.csse3200.game.ai.tasks.PriorityTask;
import com.csse3200.game.components.TouchAttackComponent;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.Melee;
import com.csse3200.game.entities.Weapon;
import com.csse3200.game.entities.factories.ProjectileFactory;
import com.csse3200.game.physics.PhysicsEngine;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.components.HitboxComponent;
Expand All @@ -17,7 +15,6 @@
import com.csse3200.game.services.GameTime;
import com.csse3200.game.services.ServiceLocator;


/**
* Task that allows mobs to shoot projectiles or melee attack towers
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@
import com.badlogic.gdx.physics.box2d.Fixture;
import com.csse3200.game.ai.tasks.DefaultTask;
import com.csse3200.game.ai.tasks.PriorityTask;
import com.csse3200.game.components.TouchAttackComponent;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.Melee;
import com.csse3200.game.entities.Weapon;
import com.csse3200.game.entities.factories.ProjectileFactory;
import com.csse3200.game.physics.PhysicsEngine;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.components.HitboxComponent;
import com.csse3200.game.physics.components.PhysicsMovementComponent;
import com.csse3200.game.physics.raycast.RaycastHit;
import com.csse3200.game.rendering.AnimationRenderComponent;
import com.csse3200.game.services.GameTime;
import com.csse3200.game.services.ServiceLocator;


/**
* Task that allows mobs to shoot projectiles or melee attack towers
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void startSwappingLane() {

currentTask.stop();

float laneHeight = (float) (viewportHeight / 8);
float laneHeight = (float) (viewportHeight) / 8;

if (currLane == 0) {
// Move up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.csse3200.game.components.CombatStatsComponent;
import com.csse3200.game.components.tasks.MovementTask;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.factories.MobBossFactory;
import com.csse3200.game.entities.factories.NPCFactory;
import com.csse3200.game.physics.PhysicsEngine;
import com.csse3200.game.physics.PhysicsLayer;
Expand All @@ -18,13 +17,9 @@
import com.csse3200.game.rendering.AnimationRenderComponent;
import com.csse3200.game.services.GameTime;
import com.csse3200.game.services.ServiceLocator;
import net.dermetfan.gdx.physics.box2d.PositionController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serial;
import java.text.DecimalFormat;

public class IceBabyTask extends DefaultTask implements PriorityTask {
private static final int PRIORITY = 3;
private static final Vector2 ICEBABY_SPEED = new Vector2(1f, 1f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.csse3200.game.components.CombatStatsComponent;
import com.csse3200.game.components.tasks.MovementTask;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.factories.MobBossFactory;
import com.csse3200.game.rendering.AnimationRenderComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public DesertGameScreen(GdxGame game) {
this.game = game;
camera = new OrthographicCamera();
camera.setToOrtho(false, viewportWidth, viewportHeight);
camera.position.set((float) (viewportWidth / 2), (float) (viewportHeight / 2), 0);
camera.position.set((float) (viewportWidth) / 2, (float) (viewportHeight) / 2, 0);

batch = new SpriteBatch();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public IceGameScreen(GdxGame game) {
this.game = game;
camera = new OrthographicCamera();
camera.setToOrtho(false, viewportWidth, viewportHeight);
camera.position.set((float) (viewportWidth / 2), (float) (viewportHeight / 2), 0);
camera.position.set((float) (viewportWidth) / 2, (float) (viewportHeight) / 2, 0);

batch = new SpriteBatch();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public LavaGameScreen(GdxGame game) {
this.game = game;
camera = new OrthographicCamera();
camera.setToOrtho(false, viewportWidth, viewportHeight);
camera.position.set((float) (viewportWidth / 2), (float) (viewportHeight / 2), 0);
camera.position.set((float) (viewportWidth) / 2, (float) (viewportHeight) / 2, 0);

batch = new SpriteBatch();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.csse3200.game.GdxGame;
import com.csse3200.game.areas.ForestGameArea;
import com.csse3200.game.areas.terrain.TerrainFactory;
Expand Down Expand Up @@ -68,7 +67,7 @@ public MainGameScreen(GdxGame game) {
this.game = game;
camera = new OrthographicCamera();
camera.setToOrtho(false, viewportWidth, viewportHeight);
camera.position.set((float) (viewportWidth / 2), (float) (viewportHeight / 2), 0);
camera.position.set((float) (viewportWidth) / 2, (float) (viewportHeight) / 2, 0);

batch = new SpriteBatch();

Expand Down

0 comments on commit 0483b8a

Please sign in to comment.