-
Create
Bounding Area
and add componentsimport base.Scene; import utility.bounding.BoundingArea; class SomeScene extends Scene { // Create BoundingArea named map BoundingArea map = new BoundingArea(); @Override void init() { /* ... */ // Some random entity JLabel box = new JLabel(); // Add that entity to map map.add("SolidBox", box); /* ... */ } }
-
Detect collision
import base.Scene; import utility.bounding.BoundingArea; import javax.swing.*; class SomeScene extends Scene { BoundingArea map = new BoundingArea(); JLabel character = null; @Override void init() { /* ... */ // Some character entity character = new JLabel(); /* ... */ } }
if (map.intersects(character)) { /* Do something */ }
-
Listen to collision event
If you want to know anytime something checking for intersection by using intersects and it intersects
map.addIntersectionListener((name /* name of entity that intersects */ ) -> { /* Do something */ return true; });
-
Notifications
You must be signed in to change notification settings - Fork 1
buskun/Hell-Kitchen
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published