Pixel-perfect collision with bullets

2

Attached Files

The following files have been attached to this tutorial:

.capx

bulletandpixelperfectcollisions.capx

Download now 173.69 KB

Stats

2,989 visits, 3,991 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 18 Apr, 2014. Last updated 19 Feb, 2019

Hi there,

This is a short tutorial on how to create pixel-perfect collisons with bullets. I will share my experience too about how its best to make it work.

The idea is basically to use a LOOP to move your bullet instead of using the bullet behavior. This is more precise.

Important note

I found something interesting... when you actuall create your bullet be sure it is positionned at an integer value position which mean you have to round it cause it will create problem once it reach the wall. The collision work with pixel integer value so if your bullet is created at lets say x: 233.444 it will move along the non-integer value of .444 and when it reach the wall it will obviously pass the wall off 1 pixel. The project option round pixel doesn't seem to fix this issue so be careful.

@Thanks to MadFactory since he referenced a MMF base idea on how to do it.

.CAPX

bulletandpixelperfectcollisions.capx

Download now 173.69 KB
  • 0 Comments

Want to leave a comment? Login or Register an account!