Refactor coordinate system
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:wolf_dart/classes/linear_coordinates.dart';
|
||||
import 'package:wolf_dart/classes/coordinate_2d.dart';
|
||||
import 'package:wolf_dart/features/entities/enemies/enemy.dart';
|
||||
import 'package:wolf_dart/features/entities/entity.dart';
|
||||
|
||||
@@ -83,7 +83,7 @@ abstract class Weapon {
|
||||
double threshold = 0.2 / dist;
|
||||
|
||||
if (angleDiff.abs() < threshold) {
|
||||
LinearCoordinates source = (x: playerX, y: playerY);
|
||||
Coordinate2D source = Coordinate2D(playerX, playerY);
|
||||
|
||||
// Delegate to the enemy to check if it's visible
|
||||
if (entity.hasLineOfSightFrom(
|
||||
|
||||
Reference in New Issue
Block a user