Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » In-The-Box
- thelilmacd
- Scratcher
4 posts
In-The-Box
Hey Guys! I'm working on doing a sort of painting-like game (it's a newbie surprise!,And I'd rather not say for fear of ‘Idea Theft’) and I need some help on creating a formula that will only allow you to paint only on the spot that should be painted. Private dress-up games I've done allow you to throw clothes all over the place, but for my public appearances I want to have the pen disabled somehow if it's not on the spot. Do I just work with a “hide” button if it is not on the spot. Could that work? Do you have any idea of how to work that? Thanks in Advance!
- elcidero
- Scratcher
39 posts
In-The-Box
Well if you made the spot that must be painted a sprite that blends in perfectly with the background, you could use this script:
I'm not sure if this is what you had in mind, but it's a start.
when green flag clicked
forever
if <touching [InsertSpriteNameHere v]?> then
pen down
else
pen up
end
end
I'm not sure if this is what you had in mind, but it's a start.
- thelilmacd
- Scratcher
4 posts
In-The-Box
Let me refrase. I have a box space that players colour in, but how do I get it to only show in the box? The problem with most painting games is the pen is allowed to go everywhere, but if it's not in the box I want to to be disabled. Do I just do a hide thing if not touching white box?
- AonymousGuy
- Scratcher
1000+ posts
In-The-Box
elcidero is right. But to expand on it, do this: Let me refrase. I have a box space that players colour in, but how do I get it to only show in the box? The problem with most painting games is the pen is allowed to go everywhere, but if it's not in the box I want to to be disabled. Do I just do a hide thing if not touching white box?
1) Make a sprite the size of your box, filled completely with white or any other color and make sure it is exactly where you want the box to be. (We will call this sprite “filledbox” for now.)
2) In the above sprite, place the following script:
when gf clicked3) In your pen sprite, place the following script:
set [ghost v] effect to (100)
when gf clicked
forever
if <<mouse down?> and <touching [filledbox v]?>> then
pen down
else
pen up
end
This should work. I hope this helps!
Last edited by AonymousGuy (Feb. 28, 2014 17:49:50)
- Discussion Forums
- » Help with Scripts
- » In-The-Box