Hi. I am creating a game and am new to it. How do I create collision and put in arrays of an object in netbeans?
Collision detection is done using "intersects." For example Rectangle.intersects(line);
Array of objects is liek any otehr array. Object[] o = new Object[10]; Rectangle[] r = new Rectangle[10];
ok. But what is the [10] mean and after Rectangle[] is the r there because it is what rectangle starts with? @KonradZuse
it seems like you need to learn more about the language itself.. I'm assuming you're using Java With Netbeans? [10] is an array of 10. r is the name of the object... That's basic.
Yes I am pretty new to the language. I just started a couple months ago. Im doing this for a project at school. And yes I am using Java with Netbeans
You can say Rectangle Tuna_Fish_sammich = new Rectangle(); if you wanted...
Join our real-time social learning platform and learn together with your friends!