GM:S 1.4 Pool game using Box2d

GM Version: GameMaker:Studio v1.4.1690Target Platform: ALLDownload: Starter ProjectLinks: YouTube VideoSummary:
Learn how to add the basics of a pool game using the built in physics capabilities of GMStudio.

I did this tutorial to see how the gameplay of pool work for an idea I have for a game but I can't make to change direction once it has begun to move the cue. I'd appreciate any help in this regard because I'm just starting and I'm a complete noob.

I did this tutorial to see how the gameplay of pool work for an idea I have for a game but I can't make to change direction once it has begun to move the cue. I'd appreciate any help in this regard because I'm just starting and I'm a complete noob.

Thank you so much!

Click to expand...

You should be able to remove the if(pulling) else part such that you can always orbit around the queue. You will also need to change a couple other areas.

Btw I see you use a lot of local vars I never do that I always use instance variables is there a big difference in performance?

Click to expand...

Treating the instance-scope-only habit as a performance problem is a myopic yet unfortunately common diagnosis. The lack of correctness is the main problem of the habit, and the bomb starts ticking once you start independent work.

The most common unwanted interaction is between looping variables inside and outside a script. Compare this correct implementation of capturing the values of 50 rolls of two dice:

And in case you think I'm creating these examples synthetically to prove a point, I'm telling you right now that they are based on actual posts I've responded to (loop counter conflict / recursion conflict). Real people have been bitten by the instance-scope-only bug, and it's not an old wives' tale. And thanks to this trend of incessant focus on performance, there is nearly zero awareness of it among rookies and intermediates.

So please stop looking at local variables in terms of performance, and stop treating it as optional or a matter of taste. It is a matter of keeping code correct and conflict-free, which often matters more than performance.

So please stop looking at local variables in terms of performance, and stop treating it as optional or a matter of taste. It is a matter of keeping code correct and conflict-free, which often matters more than performance.

Click to expand...

This. Very much this.
People often dismiss "correctness". But it's really important. Performance is something you can worry about when you have good software engineering covered.