Reaction after shooting at a wall.

Get help using Construct 2

Post » Wed May 30, 2012 5:38 pm

This was kinda hard to explain in the title, but here is my problem:

In my game I want to shoot some stuff at walls and I want a reaction, I need that reaction to spawn at a specific direction, but when shooting down to a corner I have 2 conditions being true at the same time, so I get 2 reactions, any ideas on how to prevent that? here is the .capx:

http://dl.dropbox.com/u/41571201/corner%20shoot%20C2-92.capx

I've already tried with collisions but it didn't do the trick, another problem with this is that sometimes the bullet goes way inside the block and it triggers the reaction inside it too, maybe this does not happen in this little demo, but it does happen in the game -___- any ideas, guys?

Thanks in advance for the help :)Terrato2012-05-30 19:12:54
B
43
S
14
G
8
Posts: 47
Reputation: 7,556

Post » Fri Jun 01, 2012 2:32 am

98 Views and no replies? T___T so there is really no solution?...
B
43
S
14
G
8
Posts: 47
Reputation: 7,556

Post » Fri Jun 01, 2012 2:54 am

I don't know what else to say...


... other than how about this?
http://dl.dropbox.com/u/20459682/corner_shoot_FIX.capx

Basically, I changed the way your events detect completely. Instead of checking the overlap at offset and using hardcoded numbers it'd give you more flexibility to just check where the coordinates are in relation with one another. You'll probably get it more in the capx, but basically there are no hardcoded numbers, as it checks the BeaconBoost's width property and Block's width property, and then it checks for their origins' locations. That way you can resize the block to any size you'd like and not have to recode new conditions to accomodate or use a million block objects. Convenient!
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Fri Jun 01, 2012 5:25 pm

@TL22

First of all: Thanks man! for listening to my cries for help...
Second of all: I'm having a really hard time trying to understand what you did there... specially the "block.Width / 2 - BeaconBoost.Width / 2" part...

It's great that the sprites only appear once now! :D but they also appear on the wrong places sometimes, for example, while shooting straight to the wall on the left, they appear right most of the time, but occasionally they point up too, I'm trying to get what you did to be able to tweak this and maybe fix it, but even if I can't, this works way better than what I did before, so: Thank you! I could hug you, man ToT

And before I go, just in case you read this:

I think the "block.Width / 2 - BeaconBoost.Width / 2" part is a way of saying "when it just touches the block and goes a bit into it", is that it? I also need the reaction to happen out of the blocks, so I'll have to change that... hope I don't break it T__TTerrato2012-06-01 17:26:48
B
43
S
14
G
8
Posts: 47
Reputation: 7,556

Post » Fri Jun 01, 2012 10:25 pm

The problem with fast moving bullets is that they can end up inside another sprite before a collision is detected. It might be better to use custom movement, then you can set the 'pixels per step' to determine how often it checks for collisions/overlaps.

(I'm using the free version so had to delete some layers)
cornerShoot1.capx
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Jun 01, 2012 11:01 pm

@ramones: You, sir... ROCK!

Thanks a bunch to both of you, guys! I owe you both T-T
B
43
S
14
G
8
Posts: 47
Reputation: 7,556


Return to How do I....?

Who is online

Users browsing this forum: Vodakman and 16 guests