Game Maker Studio 2: Tower Defense Game 3/3

  Рет қаралды 27,376

RealTutsGML

RealTutsGML

Күн бұрын

Пікірлер: 74
@Cablesfish
@Cablesfish 3 жыл бұрын
The code in the function scropt now has to look like this in the latest GM (2.3) function mouseOver(xx,yy,width,height){ if(mouse_x > xx && mouse_x < xx + width){ if(mouse_y > yy && mouse_y < yy + height){ return true; }else return false; }else return false; }
@novato5106
@novato5106 3 жыл бұрын
Actually just use point_in_rectangle
@Cablesfish
@Cablesfish 3 жыл бұрын
@@novato5106 Oh yeah. That'd be even better :)
@nickdaiz1111
@nickdaiz1111 Жыл бұрын
I love you
@danech7445
@danech7445 7 ай бұрын
@@novato5106where would you add that
@apelike
@apelike 2 ай бұрын
if (point_in_rectangle(mouse_x,mouse_y,x - sprite_width/2,y - sprite_height/2,x + sprite_width,y + sprite_height)) { return true; } else { return false; }
@MinecraftEnthusiast
@MinecraftEnthusiast 7 жыл бұрын
Can you please extend this please? this is by far the best tower defence series out there! show us how to add different enemies after certain levels
@CoreyHardt
@CoreyHardt 7 жыл бұрын
In your o_spawn object, the alarm[0] is where the enemies are created for each wave. So inside of your alarm[0], before creating the enemy instances, you'd want to have a check to see what level it was, and then decide which enemies to make. So for example: if global.level > 2 { instance_create_depth(x,y,-1,o_enemy2); } else { instance_create_depth(x,y,-1,o_enemy); } This code would check to see if the player is past the 2nd level or not. If they are past the 2nd level, it's going to spawn a new enemy type that you would make an object for and call it "o_enemy2". And inside of that object you can make their speed faster or give them more health.
@gfjwgldwzqfdkgdhdfdjledkdd9856
@gfjwgldwzqfdkgdhdfdjledkdd9856 3 жыл бұрын
@@CoreyHardt Yes, very nice
@Mando37408
@Mando37408 4 жыл бұрын
This is amazing I would enjoy a extra episodes for extra enemies tower different tracks etc.
@patch298
@patch298 3 жыл бұрын
I've discovered some neat things (with my version of the code at least) of bugs and kind of just interesting artifacts. 1.) If you click a tower to place and click another tower to place, (if you have enough money) they will stack and it makes 2 towers in the same place. 2.) If you have enemies coming into the range, the tower instantly shoots if it is the only enemy in range. Therefore, the tower can attack faster with a "worse spot" on the map barely having any range than just having batter range for right as the enemy spawns. 3.) Your towers can attack when the enemy is off screen, like if you extend the end path for longer than the map, and if the tower can reach that section, then the tower continuously attacks there until it is dead, so you can go onto the next wave. Which is why it is important to have a game over screen if the enemies reach the end of the track.
@lidedn7555
@lidedn7555 Жыл бұрын
Dude, the first problem is easy to solve. Just check the box "solid" on all towers and in "step" write this: if(place_meeting(x,y,oCaminho) or not place_free(x,y)) //place_free(x,y) checks if there is any solid object in the specified coordinate, in this case touching our object { color = c_red; } else { color = c_white; }
@larryteslaspacexboringlawr739
@larryteslaspacexboringlawr739 7 жыл бұрын
thank you for gamemaker video
@froggothecommentator8036
@froggothecommentator8036 5 жыл бұрын
Can you please make a part 4 about tower upgrade
@CornerBlimkie
@CornerBlimkie Жыл бұрын
Can you make an episode on making different types of enemies for the towers to shoot at? That would help me out so much!! Love your content btw, keep up the good work🙂
@epiczeven6378
@epiczeven6378 6 жыл бұрын
wow! a fully working td in 1 day. I´m very impressed, Thank you so much for this :)
@PhoenixLondon
@PhoenixLondon 6 жыл бұрын
my enemies keep coming in before the previous wave is killed, what did I forget to do???
@AndrewLeksche
@AndrewLeksche 6 жыл бұрын
Alarm 1 for Obj_Enemy "if (instance_number(obj_enemy)
@ItsNat21_
@ItsNat21_ 6 жыл бұрын
I know this tutorial is old, but you should've made the towers snap to a grid or something like that, to make it semi-neat
@sunstreak_games
@sunstreak_games 7 жыл бұрын
This set of tutorials was really helpful! Someone made a FOURTY PART tutorial for tower defense and I think that this is way better. With this, you're just setting up the basics of gameplay and you're free to do whatever you like with the rest of it. With the other one there is a lot less you can do because pretty much everything is already done for you. I have been adding a bunch of stuff to the project I'm working on while waiting for this part. Also I'm really happy that you put my idea into the video! Thanks for the tutorials!
@minegamerzado2115
@minegamerzado2115 Жыл бұрын
can you send the part 4 video?
@Vertech_
@Vertech_ 6 ай бұрын
@@minegamerzado2115 He said someone else made a 40 part series, not a 4th part to this
@ns_ml137
@ns_ml137 7 жыл бұрын
FINALLY I WAS WAITING FOREVER thanks for the series
@comedycrash7669
@comedycrash7669 7 жыл бұрын
2nd
@Nurk0m0rath
@Nurk0m0rath 2 жыл бұрын
I'm surprised you used object parenting but didn't even mention the benefits of doing your code in the parent object. You could have done all your game logic coding *once*, in the parent, and had the different towers simply inherit that functionality. Literally the only things you'd have had to change from the parents would be the objects created by the click and drag and the range and attack speed of the placed towers, along with the sprites of everything. You could have even used the tower 1 set as the parent, rather than creating an extra object. I mean, for this project I get that parent coding wasn't necessary, but this is a tutorial and the more complex the logic and the more variants that exist, the more valuable parent coding becomes.
@jonathanmaynard2551
@jonathanmaynard2551 7 жыл бұрын
RealTutsGML can you please do another Java game development series and have it be a survival game? If so can you also have it contain a procedural 2D terrain generation plz? Thanks
@williamsfamily3947
@williamsfamily3947 7 жыл бұрын
I really appreciate your tutorials and your commitment to this channel. I know you have been under criticism but don’t give up! So much blood is SUPER fun! People who don’t understand it are just that, people who don’t understand it. Thank you so much. See you in the next tutorial.
@TylerH69
@TylerH69 5 жыл бұрын
Please can I put in a request... Please could you make a tutorial where you can have a start menu and a closing menu?
@psirenvct
@psirenvct 4 жыл бұрын
thank you for this tuto mate, that's the perfect way to dive in the game's coding world!
@andreasnara
@andreasnara 5 жыл бұрын
after my tower wiped all of my enemy, the second wave started but it only spawn one enemy, not six. Can someone help? I did everything the same way as the video says
@JonathasCosta
@JonathasCosta 3 жыл бұрын
Awesome tutorial. Congrats!
@owenhobbs1758
@owenhobbs1758 7 жыл бұрын
first
@scratchnmix9511
@scratchnmix9511 4 жыл бұрын
Very nice and concise series. I wish you went more in depth on polishing aspects of it like animation/sprites as well as different enemies and more weapons.
@0kr4m
@0kr4m 2 жыл бұрын
is it just for me but the parent object isn't working :/
@hotgates9324
@hotgates9324 7 жыл бұрын
Thanks for this great tutorial. Question. Is there a way to create a script that checks where the path is to see if we can place a tower or not, instead of using objects?
@MyGameplay
@MyGameplay 6 жыл бұрын
how to add background sound,how to ad a new map if i killed 20levels or so,so many things to do xD u ever end this project?
@TylerH69
@TylerH69 5 жыл бұрын
Hi just to recommend Shaun Spading for sound. Have a look at the Platformer Tutorial that he created and there's a whole tutorial on adding sounds :-)
@diegohorseman152
@diegohorseman152 7 жыл бұрын
Hello! Great Video! How can i create an .apk??
@destroyergaming5205
@destroyergaming5205 4 жыл бұрын
how would you add 2 different enemy types
@zitnya3348
@zitnya3348 2 жыл бұрын
it works but for some reason enemies will stop to spawn after round 24. Anyone knows why?
@SirFeeshy
@SirFeeshy 6 ай бұрын
I think it just crashes the game, so you can try and code it so that once you get to that wave they win the game or something.
@samuellimin161
@samuellimin161 5 жыл бұрын
in the last part when I run tower 1 2 and 3 it doesn't shoot and kill the enemy all the scripts are correct, where is the mistake sir? Please help
@TylerH69
@TylerH69 5 жыл бұрын
I've literally just looked at that tutorial Samuel and my games perfect. If you look carefully, you will see that you have an error - probably either spelling or grammar area :-)
@tofustar6566
@tofustar6566 3 жыл бұрын
11:00
@davidyarbor3025
@davidyarbor3025 4 жыл бұрын
thank you this was great
@ns_ml137
@ns_ml137 7 жыл бұрын
7;31 is were i am on
@tpmjr42
@tpmjr42 7 жыл бұрын
3rd
@شوقالرجيعي
@شوقالرجيعي 6 жыл бұрын
Youuuuuu are awesome
@egorleonidov963
@egorleonidov963 7 жыл бұрын
cool video
@senjecko
@senjecko 7 жыл бұрын
Good lesson
@ibrahemmoo
@ibrahemmoo 7 жыл бұрын
why mouseOver doesn't work with me. it became a variable i don't no why? and it doesn't appear in the list of the functions any help?
@RealTutsGML
@RealTutsGML 7 жыл бұрын
+ibrahem hilabi We're creating the script in the video. mouseOver is not a built in function. Rewatch the video to see how we made the script
@ibrahemmoo
@ibrahemmoo 7 жыл бұрын
I understood. I forgot to name the script thx
@danisob3633
@danisob3633 5 жыл бұрын
lul
@romeorenolla4203
@romeorenolla4203 7 жыл бұрын
can i use this codes for java netbeans?
@stitch5900
@stitch5900 6 жыл бұрын
really? No
@clarencehernandez6606
@clarencehernandez6606 5 жыл бұрын
How can i put the towers in perfect grid. Because I want the tower to snaps to grid. How can I do that? Pls help me
@RealTutsGML
@RealTutsGML 5 жыл бұрын
You can add this code to the create event of the tower move_snap(32, 32);
@clarencehernandez6606
@clarencehernandez6606 5 жыл бұрын
Tnx. Sir
@draedlordion
@draedlordion 3 жыл бұрын
@@RealTutsGML This didn't work, i've tried to place it in oTower1(2,3), in oTowerParent, in oTower (draggeds) none snapped to grid
@IvanKasic
@IvanKasic 6 жыл бұрын
what did he do or what key did you press at 9:09 to do that with the code????? HALP
@emersonyoung197
@emersonyoung197 6 жыл бұрын
You've most likely figured it out by now, but in case anyone else is unsure it's the TAB key :-) 1.bp.blogspot.com/-i27bDhtC3W4/V6OFssc0LzI/AAAAAAAAAAM/8h50xEjKhu4xnKGEbhP7-6w_QosloOjBQCLcB/w1200-h630-p-k-no-nu/tabkey.png
@SirFeeshy
@SirFeeshy 6 ай бұрын
Tab
@maxdawson1166
@maxdawson1166 5 жыл бұрын
for some reason once i get to level 20 the game breaks and no enemies spawn
@AMosesPresents
@AMosesPresents 5 жыл бұрын
mine does as well, did you ever fix this?
@krainagracza9775
@krainagracza9775 4 жыл бұрын
@@AMosesPresents i have same problem :/
@andreasnara
@andreasnara 5 жыл бұрын
my second wave only spawn 1 enemy rather than 6 help
@froggothecommentator8036
@froggothecommentator8036 5 жыл бұрын
Maybe you need to reset the enemy count
@alextasarov1341
@alextasarov1341 3 жыл бұрын
I had a typo in the spawn_count = 0; but it didn’t tell me. It took me a while to figure out why xD
@Zyrex216
@Zyrex216 6 жыл бұрын
how would you make some enemies to spawn at a 2 different areas like 5 go left 5 go right i tried making new enemys the towers couldnt focus both it got confused
@karuto3013
@karuto3013 3 жыл бұрын
The enemy dont die....
@nutboybootiecoot7464
@nutboybootiecoot7464 6 жыл бұрын
I have a question, if I have two different enemy's at once(oEnemy1 and oEnemy2) in the range of a tower the tower will continue to shoot the first target(oEnemy1) then when the target is killed it will never lock on or shoot oEnemy1 instances, and will lock on the oEnemy2 and shot. But the problem to that is it will disregard Alarm0 and rapid fire oEnemy2. Could you help me with this?
Game Maker Studio 2: Tower Defense Game 1/3
17:17
RealTutsGML
Рет қаралды 67 М.
Building a Physics Engine with C++ and Simulating Machines
11:23
AngeTheGreat
Рет қаралды 699 М.
How do Cats Eat Watermelon? 🍉
00:21
One More
Рет қаралды 10 МЛН
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 70 МЛН
Please Help This Poor Boy 🙏
00:40
Alan Chikin Chow
Рет қаралды 20 МЛН
Tierlisting the BEST (and worst) GAME ENGINES
33:51
BiteMe Games
Рет қаралды 226 М.
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 680 М.
I tried using AI. It scared me.
15:49
Tom Scott
Рет қаралды 7 МЛН
Object States | Game Maker Studio 2
22:21
FriendlyCosmonaut
Рет қаралды 136 М.
TOWER DEFENSE TUTORIAL in GMS2 - PART 1: MONSTERS on PATH
22:42
Caz Creates
Рет қаралды 6 М.
GMS2 Cameras: As Simple as Possible
13:27
PixelatedPope
Рет қаралды 66 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 82 М.
Organising Data | Menus: GMS2 [P1]
28:19
FriendlyCosmonaut
Рет қаралды 67 М.
What's The Longest Word You Can Write With Seven-Segment Displays?
8:56
GameMaker - Better Saving & Loading (JSON)
25:49
Sara Spalding
Рет қаралды 46 М.
How do Cats Eat Watermelon? 🍉
00:21
One More
Рет қаралды 10 МЛН