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

#1 2013-03-04 15:58:23

kola2
Scratcher
Registered: 2012-04-28
Posts: 5

Protect the village game, need help!

So i recently made a "Protect the village" game about shooting
down The UFO's before thei destroy the 5 houses in the "village"
but i have some problems...
How can i make the UFO's explode after killed them?
But first of all i need to tell how i coded this (or then you will not be able to help me)
The sprites i made is the
"Gun" the "Gun's ammo"
2 Ufo's
1 Ufo ammo
1 Ground (only used to stop the gun ammo, nothing to really care about)
5 Houses (called House1 sprite1 sprite2 sprite3 sprite4)

Ok, i made a  2 variables...
1 for the Ufo's health and 1 for the Villages health
so everytime the gunammo/theufoammo hits a house/the ufo,
the variable (ufohealth/villagehealth) will remove 1 stats/healthpoint

But is it possible to make something that works like
"When variable (Ufohealth/VillageHealth) is 0)"
  - Change to custome "Exploding"
    - say "You won the game  big_smile "
      - Stop all scripts"

Please help me ... and if you think i coded this stupid, please do not say "You are a bad coder you should to this "Bla ... bla bla bla"

-kola2

Offline

 

#2 2013-03-04 16:02:19

kola2
Scratcher
Registered: 2012-04-28
Posts: 5

Re: Protect the village game, need help!

Oh i forgot to write something :

The script that removes 1 HP from the variable, sits inside the ammo
Not the house/ufo

Offline

 

#3 2013-03-04 16:03:25

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Protect the village game, need help!

Well, this is actually possible. I just want to make sure that I get you the best answer, so could I see your UFO scripts?

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#4 2013-03-04 16:11:10

kola2
Scratcher
Registered: 2012-04-28
Posts: 5

Re: Protect the village game, need help!

ErnieParke wrote:

Well, this is actually possible. I just want to make sure that I get you the best answer, so could I see your UFO scripts?

With regards,

ErnieParke

Ehm ... i am very new here so i don't think i can make it out of that ForumCodebox (or whatever the name is)
but here is the link for the project, you can download it and look at the scripts.
Please do not post it, i don't want that people thinks that i am remixing others work just bcz i don't wanna make my own

Link : http://scratch.mit.edu/projects/kola2/3149400

Offline

 

#5 2013-03-04 16:24:22

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Protect the village game, need help!

kola2 wrote:

ErnieParke wrote:

Well, this is actually possible. I just want to make sure that I get you the best answer, so could I see your UFO scripts?

With regards,

ErnieParke

Ehm ... i am very new here so i don't think i can make it out of that ForumCodebox (or whatever the name is)
but here is the link for the project, you can download it and look at the scripts.
Please do not post it, i don't want that people thinks that i am remixing others work just bcz i don't wanna make my own

Link : http://scratch.mit.edu/projects/kola2/3149400

Well, I won't, I promise.

Now one last question before I can begin. Do you want the UFO's to both crash once (Boss Health) reaches 0, or do you want one to crash once it reaches 6 and the other to crash once it reaches 0?

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#6 2013-03-04 16:26:53

kola2
Scratcher
Registered: 2012-04-28
Posts: 5

Re: Protect the village game, need help!

ErnieParke wrote:

kola2 wrote:

ErnieParke wrote:

Well, this is actually possible. I just want to make sure that I get you the best answer, so could I see your UFO scripts?

With regards,

ErnieParke

Ehm ... i am very new here so i don't think i can make it out of that ForumCodebox (or whatever the name is)
but here is the link for the project, you can download it and look at the scripts.
Please do not post it, i don't want that people thinks that i am remixing others work just bcz i don't wanna make my own

Link : http://scratch.mit.edu/projects/kola2/3149400

Well, I won't, I promise.

Now one last question before I can begin. Do you want the UFO's to both crash once (Boss Health) reaches 0, or do you want one to crash once it reaches 6 and the other to crash once it reaches 0?

With regards,

ErnieParke

I want both to crash/explode at the when the health reach 0

Thanks for the help :)

Offline

 

#7 2013-03-04 16:33:56

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Protect the village game, need help!

kola2 wrote:

ErnieParke wrote:

kola2 wrote:

Ehm ... i am very new here so i don't think i can make it out of that ForumCodebox (or whatever the name is)
but here is the link for the project, you can download it and look at the scripts.
Please do not post it, i don't want that people thinks that i am remixing others work just bcz i don't wanna make my own

Link : http://scratch.mit.edu/projects/kola2/3149400

Well, I won't, I promise.

Now one last question before I can begin. Do you want the UFO's to both crash once (Boss Health) reaches 0, or do you want one to crash once it reaches 6 and the other to crash once it reaches 0?

With regards,

ErnieParke

I want both to crash/explode at the when the health reach 0

Thanks for the help  smile

Well, I haven't even given it yet, though I see what you mean.  smile

Anyway, in your project, you have a script like this:

when gf clicked
forever
 change [color v] effect by (50)

You could change it to this:

when gf clicked
forever
 change [color v] effect by (50)
 if <(Boss Health) < (1)>
  Crashing scripts...
 end

Hopefully that'd be self explanatory.

Now, there's a little problem with your laser's scripts that needs to be fixed. If your UFO's die before every house is destroyed, then the laser is going to keep on shooting. To fix this, you'll need to put each of the laser's scripts in this (excluding the short one with a forever block):

if <(Boss Health) > (0)>

end

Okay, so this should be it.

I hope that this helps!

With regards,

ErnieParke

Last edited by ErnieParke (2013-03-04 16:34:36)


http://i46.tinypic.com/35ismmc.png

Offline

 

#8 2013-03-04 17:15:14

kola2
Scratcher
Registered: 2012-04-28
Posts: 5

Re: Protect the village game, need help!

Ok it work'd thanks for the help

Offline

 

#9 2013-03-04 17:37:35

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Protect the village game, need help!

kola2 wrote:

Ok it work'd thanks for the help

You're welcome! Also, good luck with your game!

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer