Discuss Scratch

finnthehuman13
New Scratcher
5 posts

How do you make a sprite you can hold and throw?

I could hold it but when I added the scripts to throw it I couldn't carry it any more. Also, how can you make it so you can only use the item once?
-Scratcher-
Scratcher
100+ posts

How do you make a sprite you can hold and throw?

Do you mean like being able to throw a Sprite so it behaves like a ball?
whenclickedsetvel_xto0setvel_yto0forevergotox:xposition+vel_xy:yposition+vel_yiftouchingmouse-pointer?andmousedown?thensetdxtoxposition-mousexsetdytoyposition-mouseyrepeatuntilnotmousedown?setlast_xtoxpositionsetlast_ytoypositiongotox:mousex+dxy:mousey+dysetvel_xto0.4*xposition-last_x0.4 is just a factor so it's not so sensitivesetvel_yto0.4*yposition-last_yiftouchingbottom?thensetvel_yto0.9*absofvel_yelsechangevel_yby-1just basic collision setup with bottom and gravity
finnthehuman13
New Scratcher
5 posts

How do you make a sprite you can hold and throw?

yeah like a ball but one that the player is holding
finnthehuman13
New Scratcher
5 posts

How do you make a sprite you can hold and throw?

the sprite I mean
deck26
Scratcher
1000+ posts

How do you make a sprite you can hold and throw?

Only using an item once is just a case of having a variable to keep track of whether it has been used or not. Eg set a variable ‘key-used’ to 0 initially and to 1 when it is used. Only allow it to be used when the variable is 0.
-Scratcher-
Scratcher
100+ posts

How do you make a sprite you can hold and throw?

Ohh, you mean like collecting items with the player so you can throw them, like when pressing E?
cs144201
New Scratcher
1 post

How do you make a sprite you can hold and throw?

I'm confused.
frazzle96
Scratcher
20 posts

How do you make a sprite you can hold and throw?

Do you want it to be thrown at something?
Paddle2See
Scratch Team
1000+ posts

How do you make a sprite you can hold and throw?

Since this topic hasn't seen a new post from the topic owner in a long time, I'm going to assume that it is dead and close the topic. If it still is alive, the topic owner just needs to use the Report button to ask a mod to reopen it

Powered by DjangoBB