New answers tagged

1

You are using rect to draw the background of the bars, but you forgot the beginPath. So the rect calls pile up and make the drawings slower and slower each frame. To explain a bit further, each non-direct draw command (arc, rect, lineTo, XXXTo) is used to build the current path. If you never use beginPath to reset the current path, the next frame will ...


1

Since i can't comment to get more information i'll do my best here. Have you tried clearing the canvas before each draw ? You could also change your code to due batch drawing instead of consecutive drawing calls as you are currently making; Another thing that may degrade the performance the fill style changes in your loop. Try to make all drawing calls ...


0

From my own experience, I've found that using the sum of components (x + y + z) is a very good measure for sorting entities in an isometric scene. It doesn't perfectly represent the distance your image is away from the camera, but it does give an indication which image is further or closer to the camera, and that's what ultimately matters. Moreover, sums are ...


0

You can use both particles (for the animation) and another system to really "paint" the surface. What I would do is use one or multiple invisible spheres that I would "trow" in direction of the canvas (with a Rigidbody, so it's affected by gravity), and then, detect collisions. You could also use Raycasting.


0

In addition to Philipp's answer: Typically, you'll try to minimize the scaling done to your images, as the renderer may not be doing a good job in pixel interpolation/stretching. So what you can do is have multiple size images for your character, that you do yourself offline: you'll see the result right away and you'll be able to either improve the image ...


2

You method makeItRed is a static method which sets a variable which is most likely also declared as static. Static variables share their value between all instances of the class. Call the method on one instance of ColorController and you affect them all. So make opacity, MakeItred and MakeItOff non-static variables and have the raycast hit code (which you ...


2

Just draw them larger. Also don't hesitate to have the sprites overlap vertically. The sprites are rendered from a 45° angle, so it is just natural that the soldiers in the front-row overlap the lower bodies of the soldiers in the row behind them. All you need to keep in mind in that case is that you need to draw them in the correct order from back to front. ...


1

There are several ways to approach this problem. When it comes to WebGL performance the key is to: (a) reduce number of drawcalls, (b) reduce gpu overdraw (fill-rate) and vertices. (c) reduce buffer data transfers. Because you're filling the screen at most once and scene complexity is low, we can totally ignore (b). (c) is a bit more complex and I'll get ...



Top 50 recent answers are included