Pick every object within range

2

Stats

4,837 visits, 7,383 views

Tools

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 13 Apr, 2012. Last updated 19 Feb, 2019

This is my first tutorial so please send me some feedback with your comment.

Introduction

In this tutorial will show you how to pick any object within some range. I could not find this event already done when i needed it so i made it my way. I needed to make when i hit a barrel of explosion, every object within some range to be destroyed.

Word or two how it will work

When i hit the desired object, it will spawn another circular object to simulate the range. In another event when that circular object is colliding with another object, it needs to be destroyed.

Lets get started

First here are three object that i will be using, feel free to use other ones.

*in my real project i use explosion Sprite from ghost shooter, but for the purpose of this tutorial i use real circle to simulate precise range.

Preparation

First load all sprites like the monster, the explosive. I use one button to start the chain but you can use all kind of events for that.

The "coding"

If you have read tutorial or two you should understand the picture below.

*when i set the size of the "Range" object that is the range within other object will be destroyed.

If you want the black circle not to be seen, lower it's opacity to "0" and don't forget to destroy after all the actions. I destroyed it with the "Fade" behavior.

Press, RUN and see if it is working for you

  • 1 Comments

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