Do-Good-Games / NoCapstone2023

The repository for the game made by the NoCapstone group at DU in Spring 2023.
1 stars 0 forks source link

regain mouse control after pause in webGL #68

Closed RyanDavidsonDev closed 8 months ago

RyanDavidsonDev commented 9 months ago

might be an issue with lockMouse()? does it work if we don't lock mouse? alternatively, what state is the mouse in before entering pause? why doesn't it go back there

RyanDavidsonDev commented 9 months ago

bad news: the issue originates from warpCursorPause() straight up not working in webGL builds. a workaround will be needed if we're still going to ship in webGL

one possible solution might involve refactoring player movement to be adjusted by change in cursor position. Rather than directly setting it as we're doing now:

if(cursor moves){

  vec2 movement = cursorPos - cursorPosFromLastFram
  playerPos += movement

instead of playerPos == cursorPos