Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tamaño automatico de canvas #134

Merged
merged 6 commits into from
Mar 20, 2024
Merged

Conversation

mind-ar
Copy link
Contributor

@mind-ar mind-ar commented Mar 13, 2024

Este PR implementa el tamaño automático del canvas, basado en la cantidad y tamaño de las celdas
Nota: la primera vez que se abre el juego, el canvas ocupa toda la pantalla, esto se corrige en el PR #132

Closes #131

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.63%. Comparing base (bcf4129) to head (cc0f18d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #134   +/-   ##
=======================================
  Coverage   85.63%   85.63%           
=======================================
  Files           9        9           
  Lines         696      696           
  Branches      161      161           
=======================================
  Hits          596      596           
  Misses        100      100           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grosooo! 🎉

Ahí dejé algunos comments.

var positionX =
visuals[i].position.x * cellPixelSize * (windowWidth / widthGame)
var y = windowHeight - 20 - visuals[i].position.y * cellPixelSize
var positionX = visuals[i].position.x * cellPixelSize
var y = gameHeight - visuals[i].position.y * cellPixelSize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acá es dónde pasa la magia? Se podría poner en una función y testear?

Comment on lines -16 to +19
widthGame = size[0]
gameWidth = size[0]
gameHeight = size[1]
resizeCanvas(gameWidth, gameHeight)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acá me perdí un toque, este size es el size del game o del canvas de la pantalla?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hola, size es un parámetro que viene desde al backend y representa el ancho y alto del juego (calculado por wollok-ts)

@PalumboN PalumboN merged commit cbdfda2 into uqbar-project:master Mar 20, 2024
3 checks passed
@mind-ar mind-ar deleted the feat-canvas-size branch March 22, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Game: no respeta la propiedad game.cellSize
2 participants