| bio | website | http://- |
|---|---|---|
| location | Switzerland | |
| age | 28 | |
| visits | member for | 1 year |
| seen | May 6 at 12:40 | |
| stats | profile views | 36 |
i like turtles... and music, games, coding... and dungeons and dragons XD
|
Jul 18 |
answered | How do I get level design practice? |
|
Jul 13 |
answered | What would make a good cursor movement sound effect? |
|
Jul 12 |
answered | Collision Detection/Map Management in RPG |
|
Jul 12 |
comment |
Shaky Camera Effect 2D See in the link in the comment for the possible duplicate if you want a more advanced (but harder to implement) solution. Basically the principle of keeping a logical and actual viewport would be the same, but the generation of movement is not liniear but more organical, because its based on a noise. But it looks quiet advanced to implement, so if you are a beginner, I would stay with a simpler solution at first. |
|
Jul 12 |
comment |
Managing text-maps in a 2D array on to be painted on HTML5 Canvas the code seems to work fine... basically you could cache those values (keep track of changes in the viewport and when the viewport was changed, when rendering, recalculate them). I just keep them in my render method, as you only need those values for rendering. |
|
Jul 11 |
comment |
Managing text-maps in a 2D array on to be painted on HTML5 Canvas Yep, this will also work. |
|
Jul 11 |
comment |
Java - Tile engine changing number in array not changing texture I'm not entirely sure, but try to adapt my proposed changes to the code. In render you use map[y][x], in load you use map[x][y] etc. Get the code straight and edit your post (include the changed code). If it still won't change the tiles, maybe something is wrong with the tilesets. Try to render only the textures and see if they are loaded correctly. |
|
Jul 11 |
comment |
Managing text-maps in a 2D array on to be painted on HTML5 Canvas Yeah, you just have to make a js based viewport class (or you could just create 4 variables x, y, w and h). Also you have to make sure to floor (Math.floor) those calculations, that are assigned to the int values. I added a code example, how the viewport class would look like. Just make sure, that you put the declaration before the usage. |
|
Jul 11 |
revised |
Managing text-maps in a 2D array on to be painted on HTML5 Canvas added js version of viewport |
|
Jul 10 |
awarded | Supporter |
|
Jul 10 |
comment |
Java - Tile engine changing number in array not changing texture I added some clarification in the answer. |
|
Jul 10 |
revised |
Java - Tile engine changing number in array not changing texture Added some explanation for a comment |
|
Jul 10 |
comment |
Managing text-maps in a 2D array on to be painted on HTML5 Canvas If you mean that the position of the camera is 531 then yes. I added some comments to the code above. |
|
Jul 10 |
revised |
Managing text-maps in a 2D array on to be painted on HTML5 Canvas Updated answer |
|
Jul 10 |
answered | Big level objects collision system for 2d game |
|
Jul 10 |
comment |
Shaky Camera Effect 2D Just noticed that I forgot to set the actual screen position in the applyScreenShake method... I corrected the code example... |
|
Jul 10 |
revised |
Shaky Camera Effect 2D corrected code example |
|
Jul 10 |
awarded | Teacher |
|
Jul 10 |
revised |
Managing text-maps in a 2D array on to be painted on HTML5 Canvas fixed typo |
|
Jul 10 |
revised |
Managing text-maps in a 2D array on to be painted on HTML5 Canvas fixed typo |