This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-04-10 20:00:22

JRL
Scratcher
Registered: 2009-03-01
Posts: 67

The Take Cover Scripting

You know how in Uncharted or Mass Effect how you can take cover, well I want to figure out how to do it for a project some of my friends and I are working on. If you have any suggestions let me know. Thanks


http://images3.wikia.nocookie.net/__cb20110318211140/callofduty/images/6/65/BlackOps-faction-logo.png

Offline

 

#2 2012-04-10 20:12:20

pi3
Scratcher
Registered: 2011-12-31
Posts: 500+

Re: The Take Cover Scripting

What does take cover mean? I'd love to help.  smile


http://i44.tinypic.com/ofdhc4.jpgThanks FreshStudios!

Offline

 

#3 2012-04-10 20:21:49

Robloxia
Scratcher
Registered: 2011-08-06
Posts: 4

Re: The Take Cover Scripting

If by "take cover" you mean get behind a wall, you could either make it a new costume and after a few seconds the cat/mascot switches to the new costume and it looks like he is taking cover. Second way is to make the cat/mascot be able to move and say an enemy was shooting at you, you could make it so the enemy won't shoot when your behind (maybe a certain color wall would help?) the wall. This might be hard scripting but I think you can pull it off. wink

Offline

 

#4 2012-04-10 20:31:34

Robloxia
Scratcher
Registered: 2011-08-06
Posts: 4

Re: The Take Cover Scripting

Here: http://scratch.mit.edu/projects/Robloxia/2460995 Copy and paste the link  smile

Offline

 

#5 2012-04-10 20:47:13

JRL
Scratcher
Registered: 2009-03-01
Posts: 67

Re: The Take Cover Scripting

Robloxia wrote:

Here: http://scratch.mit.edu/projects/Robloxia/2460995 Copy and paste the link  smile

I guess that helps a little bit, I still want to figure out how to move in and out of cover while enemy troops shoot at me in a fulent in and out motion. Thanks for the help, but it just wasn't what I was looking for.

Last edited by JRL (2012-04-10 20:48:08)


http://images3.wikia.nocookie.net/__cb20110318211140/callofduty/images/6/65/BlackOps-faction-logo.png

Offline

 

#6 2012-04-10 21:42:35

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: The Take Cover Scripting

If you want the bullets to stop moving when the hit the walls (is this right?), try this for the bullets:

when I Receive [enemy_shoot_1 v]
go to [enemy_1 v]
point towards [main_sprite v]
show
turn cw (pick random (-5) to (5)) degrees
repeat until <<touching [main_sprite v]?> or <touching [wall v]?>>
move (10) steps
end
if<touching[main_sprite v]?>
change [health v] by (-1)
end
hide
Or do you want the sprite to literally get smaller near cover?  I have a project that I made a while ago that I could upload if you want that.  It's kind of complicated though.

Last edited by MoreGamesNow (2012-04-10 21:44:27)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#7 2012-04-11 18:12:25

JRL
Scratcher
Registered: 2009-03-01
Posts: 67

Re: The Take Cover Scripting

MoreGamesNow wrote:

If you want the bullets to stop moving when the hit the walls (is this right?), try this for the bullets:

when I Receive [enemy_shoot_1 v]
go to [enemy_1 v]
point towards [main_sprite v]
show
turn cw (pick random (-5) to (5)) degrees
repeat until <<touching [main_sprite v]?> or <touching [wall v]?>>
move (10) steps
end
if<touching[main_sprite v]?>
change [health v] by (-1)
end
hide
Or do you want the sprite to literally get smaller near cover?  I have a project that I made a while ago that I could upload if you want that.  It's kind of complicated though.

This is what I was looking for, I'll test it out and let you know if I will be using it.


http://images3.wikia.nocookie.net/__cb20110318211140/callofduty/images/6/65/BlackOps-faction-logo.png

Offline

 

#8 2012-04-11 22:17:55

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: The Take Cover Scripting

Why not have the bullet sprite stop its script if it is touching any object that could be used as cover?

Offline

 

Board footer