0 Favourites

# How do I create a Vacuum/Suction effect?

• 5 posts
• Hello all!

This is my first post, and i did read up/into this before i posted, but if I make any mistakes please let me know kindly so I may correct them

My name is Mikey and I'm currently working on a project that involves the main character using a vacuum cleaner as a survival and puzzle solving tool(acts kind of like his weapon, except instead of hurting it uses suction. like... mario sunshine?). What ill need to accomplish is when i hit my attack button(lets say Z for example), that an object close enough will move towards the character.

Ultimately, the goal is for him to suck up enemies and store them in his vacuum for future use(each enemy has a property the main character can use to solve puzzles). So here im assuming the event would be some sort of gravity pulling the enemy towards the character, then once it reaches a certain point(lets say 1px away since if they touch the character takes damage, or otherwise as my action key, Z, is pushed, damage taken from that enemy is nulled?) the enemy gets vacuumed up.

Otherwise, he can use the vacuum to suction cup an obstacle and move it(again im assuming gravity pull of some kind then have it attach to me as long as my action key, Z, is held). I'm very new to construct and I was just wondering if there's a tutorial I can be directed to, or if someone has the knowledge to help me here within this post?

You all seem very knowledgeable from the posts I've read doing research and I'm hoping you guys will be just as helpful with me

Thanks again!

• Try to walk before you run tokoshiro...

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• While pressing z:

It would consist of checking the distance between player and enemy..

If the enemy is within reach, depending on the behaviour you want to use, set either it's vector or angle towards the player or simulate pressing right/left/up/down..

Increase the sucking power (speed of the enemy towards the player) depending on the distance..

Shouldn't be that hard if you know a bit about programming with construct2

But seeing this is your first post, you might want to follow some tutorials first, just to get the hang of things..

• Thanks guys.

Yeah its not like im not versed in programming, and my lead programmer is very experienced. I have a complete dev team and this will be our second game, first platformer, first using Construct 2.

I will look into some tutorials before i dive right in^^ thanks again!

• Well this does not take you all the way - but it makes sprites "move" towards you, when in a certain range and holding down "Space". These get "stored" in a variable simply by adding a number to the variable.

You can then "shoot" with them using "Q" and "E" - but not vacuum them again.

Example

Capx I got a license version so acutally not sure if people can use it ^^

The Vacumnator

Code as picture

Let me know if its useful

• 5 posts