Placing "Towers" on click [#3 Tower Defence in GameMaker ]

Channel:
Subscribers:
11,800
Published on ● Video Link: https://www.youtube.com/watch?v=gL-ZSEaecXc



Category:
Tutorial
Duration: 12:10
801 views
46


This is the 3nd video in a short Tower Defence series made in GameMaker.

What is left now is to have a mechanism that allows us to place dynamically in the game houses on a grid. To snap to a grid we use the mouse x,y coordinates and substract the mudolo (rest values) from it. Then we assign a random sprite index to the instance and pass that information to on click created house also in. And last but not least we have two checks which if true disable placing a house at this part of the grid. First we check by a collision check if there is already a house being created on this spot/grid part and second a tile index check if on this mouse position a tile other then 0 was set (0 is default and "not set"). That's it!


🚧 For the future: This series will have 3 videos where all the basics are setup and a 4th optional one where constructors are used as a solid spawning setup. The project can be downloaded and since it is ultra small, is free to use (graphics are free also, check out the notes)



πŸ’»Project + assets found here:
https://1up-indie2.itch.io/free-tower-defence-project-gamemaker

overworld graphics: Beast CC0
https://opengameart.org/content/overworld-grass-biome

Enemies:
ThKaspar Orga by
https://opengameart.org/content/micro-character-bases-basics

explosion:
JROB774 CC3by
https://opengameart.org/content/pixel-explosion-12-frames



πŸ‘‘ Support me and get fresh game art and game maker projects every month:
https://www.patreon.com/1upindie

Follow me on:
πŸ“Έ Instangram: https://www.instagram.com/1upindie
🐦 Twitter: https://twitter.com/1upIndie
πŸ’¬ Discord: https://discord.gg/gvr98nb
πŸ“œ Udemy: https://www.udemy.com/course/become-a-video-game-developer-with-gms-23/ (See youtube about page for discount)

CHAPTERS
-------------------------------------------------------------------------------------------------------
0:00 What we will do
0:49 Subscribe
1:01 The concept what we do
2:00 Draw and snap to grid
4:17 Place a house on mouse click
5:25 Assign random preview sprite for houses
6:52 Check if we can place the house there
11:48 Game shown: Itorah







Tags:
game maker tutorial
game maker studio tutorial
gamemaker studio 2 tutorial
game dev
game developer
gamemaker tower defense tutorial
gamemaker studio 2 tower defense tutorial
gamemaker studio tower defense tutorial
gms tower defence
gamemaker tower defense
gamemaker studio tower defense
tower defense game programming