Timeline for Camera movement with player
Current License: CC BY-SA 4.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 11, 2024 at 17:56 | comment | added | ggorlen | Possibly helpful: HTML5 Canvas camera/viewport - how to actually do it? | |
| Oct 23, 2023 at 15:33 | comment | added | DMGregory♦ | "I saw several methods of doing this but I ended up getting very confused with so much information" - without more information about what methods you saw or what about them confused you, we're liable to show you more of the same. To help us tailor our answers to something that will be helpful for you, it would help to edit your question to link to a source you're looked at for one method, show the code for how you attempted to apply that method to your game, and call out where you got stuck applying it, or how the behaviour of the code you've written differs from what you want. | |
| Oct 12, 2023 at 18:11 | answer | added | mrall | timeline score: 0 | |
| Oct 11, 2023 at 14:59 | comment | added | Jhon | The game are working normally. When the game starts, it render the players and the fruits inside this 25x25 canvas. But what I wanted is a functionality similar to that of agar.oi, where there is a field for example 3000x3000 and it renders only that 25x25 area of the player's position. | |
| Oct 11, 2023 at 12:42 | review | Close votes | |||
| Oct 27, 2023 at 3:01 | |||||
| Oct 11, 2023 at 12:23 | comment | added | Philipp | You wrote that you are "still having trouble being able to make the render". Can you elaborate? What's that trouble? What do you expect to show up on the screen and what shows up instead? Are there any errors in the browsers console that could hint at a runtime error in your code? | |
| Oct 11, 2023 at 12:10 | comment | added | Jhon | Sure. But the sprite is only a pixel 1 by 1 and it’s created using x and y of player. I have difficulty creating this illusion cuz my rendering function ends up rendering everything at once, a loop takes all state players and renders at once. | |
| Oct 11, 2023 at 11:15 | comment | added | Blue Herring | One thing you could consider doing is keeping the player sprite in the center of the screen, and moving the rest of the map around it. This creates the illusion that the camera and player are moving, when really they remain in place and everything else is moving. | |
| S Oct 11, 2023 at 10:11 | review | First questions | |||
| Oct 23, 2023 at 15:33 | |||||
| S Oct 11, 2023 at 10:11 | history | asked | Jhon | CC BY-SA 4.0 |