This repository has been archived by the owner on Nov 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge someAdjustments into main (#55)
* Modified Textures to optimal size, Deleted unused files * Made Player responsive to mouse position, deleted unused code * Implement Player backwords walking * Made Canvas responsive to width of screen * Branch rebased * Fix player direction Fix player direction Fix player arm direction Fix canvas scaling leading to InputHandler mouse offset. Remove PortalEntity debug message on teleport. --------- Co-authored-by: Kitt3120 <torben@schweren.dev>
- Loading branch information
1 parent
afb80d0
commit a134ec4
Showing
18 changed files
with
400 additions
and
498 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import AssetManager from "../../engine/assets/assetmanager.js"; | ||
import ConditionalTexture from "../../engine/assets/texture/conditionaltexture.js"; | ||
import Texture from "../../engine/assets/texture/texture.js"; | ||
import Services from "../../engine/dependencyinjection/services.js"; | ||
import Entity from "../../engine/entitiy/entity.js"; | ||
import Direction from "../../engine/math/direction.js"; | ||
|
||
class PlayerArm extends Entity { | ||
private _direction: Direction; | ||
|
||
public get direction(): Direction { | ||
return this._direction; | ||
} | ||
|
||
public set direction(value: Direction) { | ||
this._direction = value; | ||
} | ||
|
||
public constructor( | ||
x: number, | ||
y: number, | ||
rotation: number, | ||
centerOfMassX: number, | ||
centerOfMassY: number, | ||
scalingX: number, | ||
scalingY: number, | ||
widthExpansion: number, | ||
heightExpansion: number | ||
) { | ||
super( | ||
x, | ||
y, | ||
rotation, | ||
centerOfMassX, | ||
centerOfMassY, | ||
scalingX, | ||
scalingY, | ||
widthExpansion, | ||
heightExpansion, | ||
true, | ||
new ConditionalTexture( | ||
Services.resolve<AssetManager>("AssetManager").getTexture( | ||
"playerArmRight" | ||
), | ||
new Map<Function, Texture>([ | ||
[ | ||
() => this._direction === Direction.Left, | ||
Services.resolve<AssetManager>("AssetManager").getTexture( | ||
"playerArmLeft" | ||
), | ||
], | ||
]), | ||
100 | ||
) | ||
); | ||
|
||
this._direction = | ||
rotation > 70 || rotation < -110 ? Direction.Left : Direction.Right; | ||
} | ||
|
||
public update(delta: number): void {} | ||
} | ||
|
||
export default PlayerArm; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.