How do I create a Vacuum/Suction effect?

Just started using Construct 2? Post your questions here

Post » Sun Jun 07, 2015 11:44 pm

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 :P

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 :D

Thanks again!
B
9
S
4
Posts: 6
Reputation: 741

Post » Mon Jun 08, 2015 2:57 pm

Try to walk before you run tokoshiro...
Life is good. Have another piece of chocolate.
B
15
S
3
G
1
Posts: 28
Reputation: 1,133

Post » Mon Jun 08, 2015 3:38 pm

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jun 08, 2015 8:05 pm

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!
B
9
S
4
Posts: 6
Reputation: 741

Post » Sat Jul 04, 2015 5:55 pm

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
Image

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

Code as picture
Image

Let me know if its useful
B
16
S
8
G
1
Posts: 153
Reputation: 2,554


Return to Beginner's Questions

Who is online

Users browsing this forum: brunopalermo and 0 guests