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?
@gamemakerlocker35267 жыл бұрын
If you have a problem wi If phy_speed != 0 then do this code If phy_speed_x != 0 && phy_speed_y != 0 { exit }
@waltermg1178 жыл бұрын
excelent tutorial thxs! Im a new suscriber
@GMWolf8 жыл бұрын
+waltermg117 glad you liked it!
@waltermg1178 жыл бұрын
+GM Wolf yes, the empty project gives the motivation to follow the full tutorial, now im in minute 10...
@DemonicaaD146 жыл бұрын
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"
@GMWolf6 жыл бұрын
+Drasknes Vokola make sure you have phisivs enabled for the njevt, and for the room
@MarducEntertainment4 жыл бұрын
el link ya no esta disponible
@larryteslaspacexboringlawr7398 жыл бұрын
thank you for gamemaker tutorial
@chaichaichaich6 жыл бұрын
Great stuff. TY
@314neapple8 жыл бұрын
Pool was one of my first GM projects, brings back great memories, and well done tutorial.
@GMWolf8 жыл бұрын
Thanks! I think pool is a great way to learn some GM concepts too.
@frankluznar67395 жыл бұрын
hey i was wondering how i could give the cue more hitting power but im using game maker studio 2...
@RetroGameMaker.8 жыл бұрын
coool tutorial thank you
@spudhead1695 жыл бұрын
Great video, but the crappiest pool game ever.
@johnduba60956 жыл бұрын
for dir_vec_x /= length GMS is telling me that the / is an unexpected symbol. Any thoughts as to why?
@SeafoodDavid936 жыл бұрын
Try dir_vec_x /= length +1.0;
@doctorzoidberg30006 жыл бұрын
Great! Thank you very much for making this tutorial ;)
@LilyWater846 жыл бұрын
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);
@GMWolf6 жыл бұрын
Seems like you advent declared the cue_y variable. Make sure you spelt it correcy everywhere else.
@LilyWater846 жыл бұрын
GM Wolf it worked, thank you for the quick response
@youthmusicalive7558 жыл бұрын
What could be the problem if all the code works but you can't hit the ball?
@GMWolf8 жыл бұрын
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.
@toddsmith98597 жыл бұрын
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;
@GMWolf7 жыл бұрын
+Todd Smith you spelt length as lenght.
@toddsmith98597 жыл бұрын
awsome! i didn't see that! thanks for the fast reply1
@webmendes8 жыл бұрын
Please continue... nice tuto +1 sub
@55164725527 жыл бұрын
the link is dead .. can you update ?
@TraceurAlexSeng7 жыл бұрын
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?
@GMWolf7 жыл бұрын
+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 :)
@ammaruqail13625 жыл бұрын
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.
@GMWolf5 жыл бұрын
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
@ammaruqail13625 жыл бұрын
Alright. Thank you.
@th3l4pz807 жыл бұрын
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
@GMWolf7 жыл бұрын
You can either make the ball lighter, by reducing the density. Or you can increate the impulse you apply.
@th3l4pz807 жыл бұрын
OK but where I increase the impulse?
@GMWolf7 жыл бұрын
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 :)
@th3l4pz807 жыл бұрын
OK thx, there is a way to contact u because in a KZbin video i can do a chat haha maybe?
@GMWolf7 жыл бұрын
The GMC is a nuce place for anything GM related: forum.yoyogames.com/index.php?members/fel666.642/
@ryancurtis54257 жыл бұрын
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?
@GMWolf7 жыл бұрын
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.
@ryancurtis54257 жыл бұрын
It worked! :D Thank you!
@Silentkiller-yv2oh8 жыл бұрын
+ 1sub
@oreolovesyou957 жыл бұрын
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?
@GMWolf7 жыл бұрын
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.
@oreolovesyou957 жыл бұрын
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?
@GMWolf7 жыл бұрын
+Or Bar-Niv you could make the hole object smaller and place it further away, then create and empty black object just for aesthetics.
@chinmayanaithani8457 жыл бұрын
Hey, could you explain what are directional vectors? Are they different from the vectors used in physics?
@GMWolf7 жыл бұрын
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.
@chinmayanaithani8457 жыл бұрын
Okay! Thanks a lot!
@seanfitz12348 жыл бұрын
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?
@GMWolf8 жыл бұрын
+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;
@seanfitz12348 жыл бұрын
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.
@GMWolf8 жыл бұрын
dont do the sqrt on each x and y componenets. Do it on the distance, and then get the x and y from that.
@seanfitz12348 жыл бұрын
ah, i see. i think ive got it now. thank you very much.
@ismaelrivera54728 жыл бұрын
Great tutorial do you also know how to script this in c#?
@GMWolf8 жыл бұрын
+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.
@ismaelrivera54728 жыл бұрын
+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!!!
@GMWolf8 жыл бұрын
+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.