Skip to content

Commit

Permalink
chore: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ufocoder committed May 15, 2024
1 parent fea7062 commit 66b35c7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/ecs/systems/RenderSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,10 @@ export default class RenderSystem extends System {
}

_drawSpriteLine(screenX: number, rayAngle: number, polarEntity: PolarPosition){
const animateComponent = polarEntity.entity.getComponent(AnimatedSpriteComponent).sprite;
const spriteComponent = polarEntity.entity.getComponent(SpriteComponent).sprite;
const animateSprite = polarEntity.entity.getComponent(AnimatedSpriteComponent).sprite;
const staticSprite = polarEntity.entity.getComponent(SpriteComponent).sprite;
const projectionHeight = Math.floor(this.height / 2 / polarEntity.distance);

const sprite = animateComponent || spriteComponent;
const sprite = animateSprite || staticSprite;

const a1 = normalizeAngle(rayAngle - polarEntity.angleFrom);
const a2 = normalizeAngle(polarEntity.angleTo - polarEntity.angleFrom);
Expand Down

0 comments on commit 66b35c7

Please sign in to comment.