portal vitesse angulaire fix

This commit is contained in:
Baptiste 2023-12-27 10:35:48 +01:00
parent 39ad0953d0
commit e4aae45f36

View file

@ -129,7 +129,6 @@ class Render {
RenderPortal(x,y)
{
this.timer=(this.timer+0.1)%360
this.ctx.save();
this.ctx.translate(x+portalSize/2, y+portalSize/2);
this.ctx.rotate(this.timer * Math.PI / 180);
@ -201,8 +200,9 @@ class Render {
PNJS.forEach((pnj)=>{
this.RenderPnj(pnj.x, pnj.y, pnj.z, (pnj.dir-1)*Math.PI/4, pnj.dir!=0);
})
portals.forEach((portal) => {
this.timer=(this.timer+1)%360
portals.forEach((portal) => {
if(portal.in.z==player.z) {
this.RenderPortal(portal.in.x,portal.in.y)
}