![]() We will draw our water tiles and the reflections onto it. If you’re using views, just replace those camera width/height functions with view_wview and view_hview. ![]() Here, I’m creating a surface that is the size of the camera. Var h = camera_get_view_height(view_camera) ![]() Cottonwool can be run into one of two modes: garbage collection mode and test mode. These are difficult and time-consuming to track down, but Cottonwool makes the process quick and safe. Add a Create event and put this code: var w = camera_get_view_width(view_camera) Surfaces require you to explicitly create and destroy memory which is prone to user error and the source of many memory leaks. Place it inside this newly created “TilesInst” layer.įor this, I’ll use obj_watertiles. This layer will be used to hold the object that will draw the water tile, so it needs to stay below your normal layers so that it appears below other layers in the game. Now create an instance layer, and place it below your normal “Instances” layer. So make sure that the tile layer is invisible: So to start, you need to disable the visibility on your tile layer, because we are going to draw the tiles manually onto a surface. Note: Make sure there is no empty space below the player sprite. I just have a player object and a layer of water tiles. You can have complete top-down reflections with a realistic shader in your game, all for only 2 bucks – pay once, use it in as many projects as you like! This is what it looks like: This tutorial simply covers the mirroring of sprites and drawing them over tiles. The only issue with the Zach Bell Games tutorial is that this is designed for a platformer with a fixed room size, which you can tell from this little section of code. Here’s what we’re going to achieve through this tutorial: Final Result The Zach Bell Games tutorial requires that you know a thing or two about surfaces in Gamemaker Studio 2, and even if you don’t it’s pretty easy to follow along. Hey there, I’m back with another tutorial! In this one, you’re going to learn how to make reflections using tiles for water. ![]()
0 Comments
Leave a Reply. |