Any OOP OF Game tutorials to recommend? Trying to grasp the concept

I’m desperately trying to get my head around classes and calling/defining their attributes and was wondering if there was a basic game tutorial you guys could recommend, ideally including multiple instances of objects talking to the main app.

I have box2d set up and can create shapes, even define their species and behaviors, but can’t for the life of me figure out how to “read” their position on screen from the main update loop…

I’d even be happy if all my classes could share a single array of coordinates, but I’d rather learn to do it properly :slight_smile:

Many thanks in advance for your tips


hi alex… if you are using ofxbox2d you can do

circles[i].getPosition().x and .y  

in a for loop to get all the positions of all your objects, but if it is collisions that you are looking for you can either do it “manually” using ofdist() between two objects or you can look at the collisions example in ofxbox2d that grabs collisions directly from the box in a different way…

Woops! it’s that simple… Thanks again, Kyri! :slight_smile: