Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
[Engine]: Change GameObejctBase to GameObject2D #55
Browse files Browse the repository at this point in the history
  • Loading branch information
201flaviosilva committed Apr 5, 2022
1 parent a7db58c commit b3ee4d8
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/GameObjects/Circle/Circle.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import GameObject from "../GameObjectBase.js";
import GameObject2D from "../GameObject2D.js";
import CommonMethods from "./CommonMethods.js";
import Types from "../Types.js";

export default class Circle extends GameObject {
export default class Circle extends GameObject2D {
constructor(x, y, radius = 10, fillColor = "#ffffff", strokeColor = "#000000") {
super(x, y, fillColor, strokeColor);
this.radius = radius;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CanvasStateInstance } from "../State/CanvasState.js";
import { UtilsMathInstance } from "../Utils/Math.js";

export default class GameObject {
export default class GameObject2D {
constructor(x, y, fillColor, strokeColor) {
this.id = Math.random();
this.name = `Obj - ${this.id}`;
Expand Down
2 changes: 1 addition & 1 deletion src/GameObjects/GameObjects.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Draw
import GameObjectBase from "./GameObjectBase.js";
import GameObjectBase from "./GameObject2D.js";
import AudioPlay from "./AudioPlay/AudioPlay.js";
import Circle from "./Circle/Circle.js";
import Line from "./Line/Line.js";
Expand Down
4 changes: 2 additions & 2 deletions src/GameObjects/Line/Line.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import GameObject from "../GameObjectBase.js";
import GameObject2D from "../GameObject2D.js";
import { CanvasStateInstance } from "../../State/CanvasState.js";
import Types from "../Types.js";

export default class Line extends GameObject {
export default class Line extends GameObject2D {
constructor(x, y, endX, endY, strokeColor = "#000000") {
super(x, y, "none", strokeColor);
this.endX = endX;
Expand Down
4 changes: 2 additions & 2 deletions src/GameObjects/PhysicsGameObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { SceneManagerInstance } from "../Scenes/SceneManager.js";
import { PositionPrevisionsInstance } from "../Physics/PositionPrevisions.js";
import { CanvasStateInstance } from "../State/CanvasState.js";

import GameObject from "./GameObjectBase.js";
import GameObject2D from "./GameObject2D.js";

export default class PhysicsGameObject extends GameObject {
export default class PhysicsGameObject extends GameObject2D {
constructor(x, y, fillColor, strokeColor) {
super(x, y, fillColor, strokeColor);

Expand Down
4 changes: 2 additions & 2 deletions src/GameObjects/Polygon/Polygon.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import GameObject from "../GameObjectBase.js";
import GameObject2D from "../GameObject2D.js";
import { CanvasStateInstance } from "../../State/CanvasState.js";
import Types from "../Types.js";

export default class Polygon extends GameObject {
export default class Polygon extends GameObject2D {
constructor(x, y, vertices = [], fillColor = "#ffffff", strokeColor = "#000000") {
super(x, y, fillColor, strokeColor);
this.vertices = vertices;
Expand Down
4 changes: 2 additions & 2 deletions src/GameObjects/Rectangle/Rectangle.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import GameObject from "../GameObjectBase.js";
import GameObject2D from "../GameObject2D.js";
import CommonMethods from "./CommonMethods.js";
import Types from "../Types.js";

export default class Rectangle extends GameObject {
export default class Rectangle extends GameObject2D {
constructor(x, y, width = 100, height = 100, fillColor = "#ffffff", strokeColor = "#000000") {
super(x, y, fillColor, strokeColor);
this.width = width;
Expand Down
4 changes: 2 additions & 2 deletions src/GameObjects/Text/Text.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import GameObject from "../GameObjectBase.js";
import GameObject2D from "../GameObject2D.js";
import { CanvasStateInstance } from "../../State/CanvasState.js";
import Types from "../Types.js";

export default class Text extends GameObject {
export default class Text extends GameObject2D {
constructor(x, y, text = "", fillColor = "#000000", strokeColor = "#ffffff") {
super(x, y, fillColor, strokeColor);
this.text = text;
Expand Down
4 changes: 2 additions & 2 deletions src/GameObjects/Triangle/Triangle.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import GameObject from "../GameObjectBase.js";
import GameObject2D from "../GameObject2D.js";
import { CanvasStateInstance } from "../../State/CanvasState.js";
import Types from "../Types.js";

export default class Triangle extends GameObject {
export default class Triangle extends GameObject2D {
constructor(x, y, width, height, fillColor = "#ffffff", strokeColor = "#000000") {
super(x, y, fillColor, strokeColor);
this.width = width;
Expand Down

0 comments on commit b3ee4d8

Please sign in to comment.