How do I Create a shield

Get help using Construct 2

Post » Tue Feb 24, 2015 3:55 pm

I am triying to create a guy using a shield that if it is attcaked from the front it will reflect the projectile and if it is attacked from the back it hurts him,Does anyone have any idea?
B
3
Posts: 5
Reputation: 185

Post » Tue Feb 24, 2015 4:00 pm

A sprite, pinned to the player.

Then bullet, on collision with shield > reverse the angle
on collision with player > subsctract health.

Should work :)
B
6
S
1
Posts: 45
Reputation: 509

Post » Wed Feb 25, 2015 2:43 pm

another sprite for the shield?
B
3
Posts: 5
Reputation: 185

Post » Wed Feb 25, 2015 4:06 pm

invisible sprite he means
B
255
S
39
G
15
Posts: 1,982
Reputation: 41,005

Post » Wed Feb 25, 2015 7:42 pm

lol
just make a invisible sprite in
and pin the angle and position of it to the main charachter on start of layout
then if you bullets that are shot at the main hero are using bullet behavior add behavior solid behavior to the shield. and for the bullets change change the bullet behavior properties that says bounce of solid object to yes. and its done :) u dont need crazy stuff is to simple... il do a capx
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005

Post » Wed Feb 25, 2015 8:10 pm

so here it is,,... however not sure how it will perform when you will try to jump through platforms since its a solid. i wold make a custom event bounce effect

shield example.capx



eh and here is the one that allows u to jump through platforms and still rejecting bullets

shield example 2.capx



for the shield to make it invisible just set the opacity to 0
You do not have the required permissions to view the files attached to this post.
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005

Post » Wed Feb 25, 2015 11:39 pm

lol... i started doing u the shield, and then i couldnt stop not to make it more cool :))))

here it is the hero with sword, shield and breath effect

Hero with shield and sword.capx
You do not have the required permissions to view the files attached to this post.
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005

Post » Thu Feb 26, 2015 2:18 am

@gamecorpstudio Hey, learn to edit your posts. Nobody like a double post, not to mention triple posts.
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Thu Feb 26, 2015 3:15 am

Hasuak wrote:@gamecorpstudio Hey, learn to edit your posts. Nobody like a double post, not to mention triple posts.

my bad sorry :) forgot to edit them, i was just posting faster this way :)

edited :
hope you enjoy my capx though :P
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005

Post » Thu Feb 26, 2015 6:15 am

Does the bullet behavior include raycasting collisions? If not, there may be "bullet through a sheet of paper" problems where it skips through the thin shield because the shield is thinner than the amount the bullet moves in one frame.

My solution to that, in a top down adventure game, is to compare the direction of the bullet(or sword swipe) as it hits the player. If the bullet comes in withing 45 degrees of Player.angle+180, the the player gets the shield bonus to armor.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests