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

#1 2010-06-08 19:14:31

adiguy17
Scratcher
Registered: 2010-05-04
Posts: 17

Game Help-Priority 1!!!

I was making this game where if my character buys an invincibility potion, and is pressing the number 5 on the keyboard he would defeat all of the enemies by touching them. Also, I made it that if the enemy is touching the main character, the main character would lose 10 life points. How do I make it so that both of these can work? If I work it right now, I am losing life while I am Invincible.
Now for my second problem. Right now I need to hold down the 5 button on the keyboard and be touching the enemy for him to die. I want it so that you have to only press the 5 button once and you can kill all of the enemies. I also want the Invincibility to wear off after 15 seconds. Help me Please!!!!!!

Offline

 

#2 2010-06-08 20:09:20

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

Re: Game Help-Priority 1!!!

Problem #2 Answer:
Use a script like this to tell the enemies to be killed when 5 is pressed
<when[ 5 ]key pressed>
<broadcast[ something
For invincibility to wear off after fifteen seconds, include this in a script
<wait( 15 )secs>

I'm not the best help, so maybe someone else can help. Good Luck, I can't wait to see what you design!  wink

Last edited by coka (2010-06-08 20:11:24)


http://i42.tinypic.com/2rot8c2.png

Offline

 

#3 2010-06-09 14:23:35

4lover
Scratcher
Registered: 2010-04-24
Posts: 500+

Re: Game Help-Priority 1!!!

OK heres how it can work for your first problem Maybe when your Main Character buys the invincibility potion and presses five you can do this <when[  5]key pressed> and do how you buy the invincibility potion<switch to costume[ 2( costume 2 must be a different color for the whole main character as costume1)<wait( 15 )secsc><switch to costume[ 1 . This should take care of your problems!

Last edited by 4lover (2010-06-09 14:24:10)


Check out this awesome new zombie-cod type of game: http://scratch.mit.edu/projects/4lover/1975649

Offline

 

#4 2010-06-09 20:39:58

GlitchSprite
Scratcher
Registered: 2010-06-08
Posts: 1000+

Re: Game Help-Priority 1!!!

As an answer to your first problem, use this script.

<when[5]key pressed>

Then, copy all of the character's 'moving' costumes and 'standing' costumes. Outline them in a different color (green, blue). If you want your enemies to go away when killed, give them this script.
<when green flag clicked>
<forever>
<if> <touching color[ what color on the outline ]
<hide>

Hope that answers your question!


http://www.mspaintadventures.com/storyfiles/hs2/02915.gif

Offline

 

#5 2010-06-10 08:06:53

scratchisthebest
Scratcher
Registered: 2009-02-08
Posts: 500+

Re: Game Help-Priority 1!!!

Problem 2 sound-effects:

[blocks]<when I receive[ invincible]>
<play sound[ invincible]>
<wait( 10 )secs>
<play sound[ almostnoinvincible]>
<repeat(5)>
<switch to costume[ normal]>
<wait( 1 )secs>
<switch to costume[ invincible]>
<end> [/blocks]

There was a typo in the forum block specs... secsc is wrong, it's secs.

Oh and my pc will restart in 6 min 30 secs, bye!

Last edited by scratchisthebest (2010-06-10 08:09:12)


bye 1.4, we all loved you. but we all outgrew the site. 2.0 is a welcome change.
http://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.png

Offline

 

Board footer