New answers tagged

1

A 2D game of Tetris can indeed run very fast on current day computers. Because this is maybe the first time you programmed a frame rate measuring tool it is hard to say if you can trust it. You could of course run a third party tool to measure the framerate of your tetris game. There are many tools to choose from, some hidden in the control panel of your GPU ...


1

The game mechanics of Tetris are not very computationally expensive. It ran fine on the 4.19 MHz CPU of my Nintendo Game Boy in 1990. And I don't know what your version of Tetris does for the visual representation. With enough time, creativity and knowledge of GFX programming, it is perfectly possible to create a Tetris version full of fancy but expensive ...


2

they can't derive from a base class. Yes, they share many of the same properties but they also share many unique properites. – xmaximix 1 Actually I think you can. This a pattern I use all the time for stuff like this and it works very well. First, I suggest your abilities derive not from Monobehaviour, but from ScriptableObject. They won't recieve events, ...


5

I know that you tagged the question as unity-webgl, but some people might find this question while developing a desktop game and might find this answer useful: For a desktop game, you can use the method Screen.SetResolution(int width, int height, bool fullscreen) to change the resolution at runtime. Note that when you do not pass false for the third argument,...


11

One way to limit the resolution of your game is to have your camera render to a RenderTexture. You can create a RenderTexture in script to match the current aspect ratio of your window/screen, or even adapt the resolution of the texture dynamically in response to performance measurements. Assign it to the target texture property of your camera to redirect ...


5

The text & button size issue can be addressed by changing the Canvas Scaler component on the canvas to a mode other than Constant Pixel Size: In Scale With Screen Size mode, you set a reference resolution that the UI elements are scaled to, regardless of the actual pixel dimensions of the running game canvas. To restrict the WebGL to a certain ...


Top 50 recent answers are included