This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » New Scratchers
  •  » I need to know how to throw an object and give damage to another?

#1 2009-12-05 17:13:55

Muki
Scratcher
Registered: 2009-12-05
Posts: 1

I need to know how to throw an object and give damage to another?

It's very simple, I just want to be able to throw a rock, to make it hit another object and give an effect of damage onto it.

Offline

 

#2 2009-12-05 17:24:15

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: I need to know how to throw an object and give damage to another?

Ooh, that's complicated. What do you mean? Any specific part you want to know?


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#3 2009-12-05 19:55:17

Llennoccm7
Scratcher
Registered: 2008-01-20
Posts: 100+

Re: I need to know how to throw an object and give damage to another?

Muki wrote:

It's very simple, I just want to be able to throw a rock, to make it hit another object and give an effect of damage onto it.

Visit My website Scratch Tutors!
And request it!


Go to PipeIineGames! The First Annual Scratch Awards!
http://img411.imageshack.us/img411/8658/llennoccm7.png

Offline

 

#4 2009-12-05 21:19:38

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: I need to know how to throw an object and give damage to another?

Llennoccm7 wrote:

Muki wrote:

It's very simple, I just want to be able to throw a rock, to make it hit another object and give an effect of damage onto it.

Visit My website Scratch Tutors!
And request it!

You're advertising, or spamming and that is not okay. Just advertise it in show and tell. Not to be mean or anything...  smile


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#5 2009-12-05 21:30:01

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: I need to know how to throw an object and give damage to another?

Just use this:
When I recieve [RockThrow]
if <touching [rock]
switch to costume [damage]
end of if

You can put repeat until (variable), but that would be more complicated.

Offline

 

#6 2009-12-05 21:31:29

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Re: I need to know how to throw an object and give damage to another?

For the rock,
When clicked
glide (seconds) sec. to object x object y

there you go. Hope that helped!  big_smile

Offline

 

#7 2009-12-27 23:33:02

Chatter
Scratcher
Registered: 2009-11-29
Posts: 500+

Re: I need to know how to throw an object and give damage to another?

Here's the script for the person who gets attacked, you'll have to find out the other scripts yourself. It's pretty simple:

<when green flag clicked>
<forever>
<if><touching[  rock
<change{  score  }by( 1
<end>

<when green flag clicked>
<set{  score  }to(  0


http://img19.imageshack.us/img19/2339/mcdonaldsjoke.gifAll your problems are like batter when you add a little Chatter, because when you have Chat, you're safe from bats.  big_smile
"And so?" - The little people in my brain|Status: Snow in April?

Offline

 

#8 2009-12-28 05:58:08

Buggy132k9
Scratcher
Registered: 2009-12-19
Posts: 19

Re: I need to know how to throw an object and give damage to another?

Well, if you mean Like a player throws a rock and it hits someone...
Heres the script im using for a bullet, straight out of my up and coming project.
I'll get the script for my enemy, and it shouldn't be too hard to adapt it.
<forever if><mouse down?>
<if><( Ammo <>> 0 )>
<go to[ player
<change{ Ammo }by( -1
<show>
<point towards( Mouse
<repeat until><touching[ Baddie
<move( 10 )steps>
<end>
<hide>

Of course, you can leave out the ammo bits if you have unlimited ammo, and i've taken out some of the scripts i have used such as sounds, different costumes (different weapons) and un needed things like that.
I'm guessing Enemy script would be a bit like

Forever
If touching Bullet
Change my health by damage

Thats just a guess what it'd be, but you could change damage for just a number, which saves you making a new variable, but it also means that you can't change the amount of damage you do.

And my health would be a variable just for the bad guy.

Offline

 

#9 2009-12-30 10:55:59

rocket101
Scratcher
Registered: 2009-08-21
Posts: 500+

Re: I need to know how to throw an object and give damage to another?

Try this http://www.freeimagehosting.net/uploads/c52ed0975c.gif. I hope it helps!

Offline

 
  • Index
  •  » New Scratchers
  •  » I need to know how to throw an object and give damage to another?

Board footer