Pool game in Gamemaker studio

  Рет қаралды 11,238

GM Wolf

GM Wolf

Күн бұрын

Пікірлер: 61
@svinta
@svinta 6 ай бұрын
THANK YOU How would I make the pool cue go closer to the ball when you release the left mouse button, so it looks like it's actually hitting the ball?
@gamemakerlocker3526
@gamemakerlocker3526 7 жыл бұрын
If you have a problem wi If phy_speed != 0 then do this code If phy_speed_x != 0 && phy_speed_y != 0 { exit }
@waltermg117
@waltermg117 8 жыл бұрын
excelent tutorial thxs! Im a new suscriber
@GMWolf
@GMWolf 8 жыл бұрын
+waltermg117 glad you liked it!
@waltermg117
@waltermg117 8 жыл бұрын
+GM Wolf yes, the empty project gives the motivation to follow the full tutorial, now im in minute 10...
@DemonicaaD14
@DemonicaaD14 6 жыл бұрын
I keep on getting two errors on my second iteration. First one worked fine, I copy the code to the new project and suddenly it throws "Not set before defining" on the line "if (phy_speed != 0) then exit;" Remove that code I get a different error on mouse release, "The instance does not have an associated physics representation"
@GMWolf
@GMWolf 6 жыл бұрын
+Drasknes Vokola make sure you have phisivs enabled for the njevt, and for the room
@MarducEntertainment
@MarducEntertainment 4 жыл бұрын
el link ya no esta disponible
@larryteslaspacexboringlawr739
@larryteslaspacexboringlawr739 8 жыл бұрын
thank you for gamemaker tutorial
@chaichaichaich
@chaichaichaich 6 жыл бұрын
Great stuff. TY
@314neapple
@314neapple 8 жыл бұрын
Pool was one of my first GM projects, brings back great memories, and well done tutorial.
@GMWolf
@GMWolf 8 жыл бұрын
Thanks! I think pool is a great way to learn some GM concepts too.
@frankluznar6739
@frankluznar6739 5 жыл бұрын
hey i was wondering how i could give the cue more hitting power but im using game maker studio 2...
@RetroGameMaker.
@RetroGameMaker. 8 жыл бұрын
coool tutorial thank you
@spudhead169
@spudhead169 5 жыл бұрын
Great video, but the crappiest pool game ever.
@johnduba6095
@johnduba6095 6 жыл бұрын
for dir_vec_x /= length GMS is telling me that the / is an unexpected symbol. Any thoughts as to why?
@SeafoodDavid93
@SeafoodDavid93 6 жыл бұрын
Try dir_vec_x /= length +1.0;
@doctorzoidberg3000
@doctorzoidberg3000 6 жыл бұрын
Great! Thank you very much for making this tutorial ;)
@LilyWater84
@LilyWater84 6 жыл бұрын
whenever i try and run the game, this error pops up, Any thought why? FATAL ERROR in action number 1 of Draw Event for object obj_cue_ball: Push :: Execution Error - Variable Get -7.cue_y(100007, -2147483648) at gml_Object_obj_cue_ball_DrawEvent_1 (line 18) - cue_dir = point_direction (cue_x, cue_y, x, y);
@GMWolf
@GMWolf 6 жыл бұрын
Seems like you advent declared the cue_y variable. Make sure you spelt it correcy everywhere else.
@LilyWater84
@LilyWater84 6 жыл бұрын
GM Wolf it worked, thank you for the quick response
@youthmusicalive755
@youthmusicalive755 8 жыл бұрын
What could be the problem if all the code works but you can't hit the ball?
@GMWolf
@GMWolf 8 жыл бұрын
in that case the code is not working ^^ Make sure you copied all the code correctly: I cant really think of a likely reason for it to happen.
@toddsmith9859
@toddsmith9859 7 жыл бұрын
when i try to run the game i get the following error i can't seem to find where i went wrong. can you help me? FATAL ERROR in action number 1 of Draw Event for object obj_ball: Variable obj_ball.lenght(100006, -2147483648) not set before reading it. at gml_Object_obj_ball_DrawEvent_1 (line 9) - dir_vec_x /= lenght;
@GMWolf
@GMWolf 7 жыл бұрын
+Todd Smith you spelt length as lenght.
@toddsmith9859
@toddsmith9859 7 жыл бұрын
awsome! i didn't see that! thanks for the fast reply1
@webmendes
@webmendes 8 жыл бұрын
Please continue... nice tuto +1 sub
@5516472552
@5516472552 7 жыл бұрын
the link is dead .. can you update ?
@TraceurAlexSeng
@TraceurAlexSeng 7 жыл бұрын
How do I add on to the current codes written by you so that everytime I hit the white cue ball, 1 turn would be deducted away and the game will be over once I have no turns left?
@GMWolf
@GMWolf 7 жыл бұрын
+DJ Fahrenhigh if something as simple as subtracting one from a variable is too complicated for you, I suggest you tackle more simple projects first to learn GML. You will quickly realize that this sort of modification is trivial. As with everything, learning to code is a progressive thing: you have to start small. Good luck :)
@ammaruqail1362
@ammaruqail1362 5 жыл бұрын
Hey GM Wolf. I have followed ur tutorial. Everything went well except the line 'if (phy_speed !=0) then exit'. My 'phy_speed' variable did not work. Can u help so my cue will dissappper when the ball hit.
@GMWolf
@GMWolf 5 жыл бұрын
There is a whole range of problems that could cause this. If you code make a thread in the GMC (forum.yoyogames.com) explaining your issue, and your code, then people will be able to help you there If you mention me (@GMWolf) Ill receive a notification and be able to help you to
@ammaruqail1362
@ammaruqail1362 5 жыл бұрын
Alright. Thank you.
@th3l4pz80
@th3l4pz80 7 жыл бұрын
hey i need help with the cue ball when i hit the cue ball go soooo slowly i don't know how to make it to hit it and to go fast, can u help me pls? sorry for my english
@GMWolf
@GMWolf 7 жыл бұрын
You can either make the ball lighter, by reducing the density. Or you can increate the impulse you apply.
@th3l4pz80
@th3l4pz80 7 жыл бұрын
OK but where I increase the impulse?
@GMWolf
@GMWolf 7 жыл бұрын
notice the "physics_apply_impulse" line of code? Perhaps that is it! It does not sound like you understand the code, perhaps this is my fault, or perhaps you have simply been copying the code down, just wanting to get some free code to get you started. If that is the case, then stop: you will get no where. My code really isnt robust, or flexible enough to be properly used in a game. The code is here to teach you new techniques and patterns. Otherwise, i would simply post the project for you to download :)
@th3l4pz80
@th3l4pz80 7 жыл бұрын
OK thx, there is a way to contact u because in a KZbin video i can do a chat haha maybe?
@GMWolf
@GMWolf 7 жыл бұрын
The GMC is a nuce place for anything GM related: forum.yoyogames.com/index.php?members/fel666.642/
@ryancurtis5425
@ryancurtis5425 7 жыл бұрын
Great tutorial! I just have a small question: How would you go about making a scratching system, as in, if the cue ball touches a hole, it goes back to the starting position instead of destroying itself?
@GMWolf
@GMWolf 7 жыл бұрын
In the cue ball object, in the collision with hole object event, add something like x =xstart; y = ystart; This should put it bak to its starting position.
@ryancurtis5425
@ryancurtis5425 7 жыл бұрын
It worked! :D Thank you!
@Silentkiller-yv2oh
@Silentkiller-yv2oh 8 жыл бұрын
+ 1sub
@oreolovesyou95
@oreolovesyou95 7 жыл бұрын
Hi there! I was able to make the game but for some reason every time a colored ball touches the black square (hole) then the black square starts moving as well instead of staying at a fixed point and i'm not sure why thats happening.... any ideas?
@GMWolf
@GMWolf 7 жыл бұрын
Make sure the density of your hole object is set to 0. This is something i forgot to cover in the video: But if the density is set to 0, It will effectively have infinite density, acting as an immovable object.
@oreolovesyou95
@oreolovesyou95 7 жыл бұрын
Awesome thanks!! is there a way to make the white ball not be able to enter the hole? Or if it does to have it restart at a specific point?
@GMWolf
@GMWolf 7 жыл бұрын
+Or Bar-Niv you could make the hole object smaller and place it further away, then create and empty black object just for aesthetics.
@chinmayanaithani845
@chinmayanaithani845 7 жыл бұрын
Hey, could you explain what are directional vectors? Are they different from the vectors used in physics?
@GMWolf
@GMWolf 7 жыл бұрын
they are the same thing. In this context its a vector where all you care about its the direction it points in, not its size.
@chinmayanaithani845
@chinmayanaithani845 7 жыл бұрын
Okay! Thanks a lot!
@seanfitz1234
@seanfitz1234 8 жыл бұрын
i followed this tutorial for a golf game I'm making and I'm having trouble with the physics of the ball. with a small pull i find it moves too far, and with a large pull, it doesnt move far enough. do you know any methods i could try to fix this?
@GMWolf
@GMWolf 8 жыл бұрын
+seanfitz1234 you could square the distance. Try playing around with force = x sqrt(dist/y). Change x and y till you find what you need. (I would suggest making y ~10 and x~20;
@seanfitz1234
@seanfitz1234 8 жыл бұрын
i followed that and for the speed, it works like a charm. however, my ball now sometimes goes sideways and backwards. ill play arround with it and see if i can get it working propperly. Thanks anyway.
@GMWolf
@GMWolf 8 жыл бұрын
dont do the sqrt on each x and y componenets. Do it on the distance, and then get the x and y from that.
@seanfitz1234
@seanfitz1234 8 жыл бұрын
ah, i see. i think ive got it now. thank you very much.
@ismaelrivera5472
@ismaelrivera5472 8 жыл бұрын
Great tutorial do you also know how to script this in c#?
@GMWolf
@GMWolf 8 жыл бұрын
+Ismael Rivers im only just starting to use c#, but its rather similar to java (which I'm most familiar with). I think it would be rather similar code anyways, as side from setting up the box2D world.
@ismaelrivera5472
@ismaelrivera5472 8 жыл бұрын
+GM Wolf I am a beginner of all beginners i am trying to teach myself to make a pool game cant figure out how to make the cue rotate around the cueball your tutorial is the only one i found and its perfect so thank you for that! now if i only new how to code lol!!!
@GMWolf
@GMWolf 8 жыл бұрын
+DefaultMinerXD if you subtract mouse_x from x, you get the amount you must change x by to get mouse x. Doing it to both x and y coordinates means you get a vector in the direction from mouse to x,y position. Read up on vectors if you want to understand better.
Simple lighting system for GMS2 - GMWolf
8:02
GM Wolf
Рет қаралды 15 М.
GMWolf - Simple Lighting effect in Gamemaker
27:03
GM Wolf
Рет қаралды 34 М.
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 102 МЛН
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 102 МЛН
Как мы играем в игры 😂
00:20
МЯТНАЯ ФАНТА
Рет қаралды 3,2 МЛН
GameMaker Studio 2: Isometric Game Tutorial
35:44
Sara Spalding
Рет қаралды 111 М.
[GameMaker Tutorial] Enemy AI Maze Pathfinding
18:00
Heartbeast
Рет қаралды 104 М.
choosing a game engine is easy, actually
15:08
samyam
Рет қаралды 503 М.
How I Do It: Smart Clickable GUI
17:22
PixelatedPope
Рет қаралды 26 М.
GameMaker Studio 2! Workspace - GMWolf
8:26
GM Wolf
Рет қаралды 3,9 М.
[Game Maker Tutorial] Carousel Menu/Character Selection
14:56
GeekyBrackets
Рет қаралды 13 М.
Grid Aligned Movement - GMWolf
8:33
GM Wolf
Рет қаралды 30 М.
Flowing Water Shaders - GameMaker Tutorial
25:01
DragoniteSpam
Рет қаралды 7 М.
Make a Game in GameMaker | Bounce or Break!
31:41
GameMaker
Рет қаралды 14 М.
[GameMaker Tutorial] Zelda Hearts + For Loops
25:44
Heartbeast
Рет қаралды 29 М.
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 102 МЛН