Discuss Scratch
- Discussion Forums
- » Suggestions
- » *touching edge* (separating "edge" into four)
- _Hope
-
Scratcher
100+ posts
*touching edge* (separating "edge" into four)
Right now, we have
-top edge
-right edge
-bottom edge
-left edge
(the direction-wise words can be changed, because “top edge” and the others doesn't sound very right to me) (see adjustment provided by LionsStair below)
I hope the rest is self-explanatory.
Note: I am not proposing the removal of <touching edge?>.
<touching [edge v] ?>But that is very general. I think there should be four more “things” added to that dropdown:
-top edge
-right edge
-bottom edge
-left edge
(the direction-wise words can be changed, because “top edge” and the others doesn't sound very right to me) (see adjustment provided by LionsStair below)
I hope the rest is self-explanatory.
Note: I am not proposing the removal of <touching edge?>.
Last edited by _Hope (Jan. 25, 2015 15:50:57)
- LionsStair
-
Scratcher
100+ posts
*touching edge* (separating "edge" into four)
Right now, we haveMaybe instead of right, left, top, bottom, maybe try these:<touching [edge v] ?>But that is very general. I think there should be four more “things” added to that dropdown:
-top edge
-right edge
-bottom edge
-left edge
(the direction-wise words can be changed, because “top edge” and the others doesn't sound very right to me)
I hope the rest is self-explanatory.
<touching [positive y edge v] ?>//Top
<touching [negative y edge v] ?>//Bottom
<touching [positive x edge v] ?>//Right
<touching [negative v] ?>//Left
Anyways, I need it for my platform so support!
- TheHockeyist
-
Scratcher
1000+ posts
*touching edge* (separating "edge" into four)
Indifferent. But at least it's not as vague as
<touching [that edge v] ? :: sensing>I support this, yet keeping the touching edge block as an option, because no one wants to do:
<<<touching [that edge v] ? :: sensing> or <touching [that other one v] ? :: sensing>> or <<touching [no this one v] ? :: sensing> or <touching [i meant that one v] ? :: sensing>
Last edited by TheHockeyist (Jan. 25, 2015 15:39:45)
- _Hope
-
Scratcher
100+ posts
*touching edge* (separating "edge" into four)
Right now, we haveNote: I am not proposing the removal of <touching edge?>. (now specified in suggestion)<touching [edge v] ?>But that is very general. I think there should be four more “things” added to that dropdown:
-top edge
-right edge
-bottom edge
-left edge
(the direction-wise words can be changed, because “top edge” and the others doesn't sound very right to me)
I hope the rest is self-explanatory.
Last edited by _Hope (Jan. 25, 2015 15:49:41)
- Wes64
-
Scratcher
500+ posts
*touching edge* (separating "edge" into four)
it is possible to write this code with simple boolean expressions.
<<touching [edge v]> and <(x position) > [0]>> //Right edge
<<touching [edge v]> and <(x position) < [0]>> //Left edge
<<touching [edge v]> and <(y position) > [0]>> //Top edge
<<touching [edge v]> and <(y position) < [0]>> //Bottom edge
- stickfiregames
-
Scratcher
1000+ posts
*touching edge* (separating "edge" into four)
it is possible to write this code with simple boolean expressions.Not always.<<touching [edge v]> and <(x position) > [0]>> //Right edge
<<touching [edge v]> and <(x position) < [0]>> //Left edge
<<touching [edge v]> and <(y position) > [0]>> //Top edge
<<touching [edge v]> and <(y position) < [0]>> //Bottom edge

<<touching [edge v]> and <(y position) > [0]>> //Top edgereturns true, but the sprite is not touching the top edge.
As far as I can tell, the only way to work around this perfectly is to either use an invisible sprite on each edge, or to store the height and width of every costume on both sides of the centre and use that to calculate it.
- Wes64
-
Scratcher
500+ posts
*touching edge* (separating "edge" into four)
Not always.shoot, i forgot. you need to define the value based on costume width (assuming costume is centered logically, otherwise you might need offset)
~image~<<touching [edge v]> and <(y position) > [0]>> //Top edgereturns true, but the sprite is not touching the top edge.
As far as I can tell, the only way to work around this perfectly is to either use an invisible sprite on each edge, or to store the height and width of every costume on both sides of the centre and use that to calculate it.
<<touching [edge v]> and <(x position) > ((width) / (2))>> //Right edge
<<touching [edge v]> and <(x position) < ((width) / (-2))>> //Left edge
<<touching [edge v]> and <(y position) > ((height) / (2))>> //Top edge
<<touching [edge v]> and <(y position) < ((height) / (-2))>> //Bottom edge
Last edited by Wes64 (Jan. 26, 2015 23:41:53)
- Letsgopitt
-
Scratcher
500+ posts
*touching edge* (separating "edge" into four)
I support and thing that “top edge, right edge, etc.” is fine.
- Pot-of-Gold
-
Scratcher
1000+ posts
*touching edge* (separating "edge" into four)
Sorry if this is a necropost, btw necroposting on suggestions is ok to show your support
support
support
- scrooge200
-
Scratcher
1000+ posts
*touching edge* (separating "edge" into four)
Or, maybe something like this.
You click the block, then it says “Select Edges”, and you get a diagram of the Stage and you can select which edges you want.
You click the block, then it says “Select Edges”, and you get a diagram of the Stage and you can select which edges you want.
- Critic2100
-
Scratcher
1000+ posts
*touching edge* (separating "edge" into four)
Or, maybe something like this.Support for this.
You click the block, then it says “Select Edges”, and you get a diagram of the Stage and you can select which edges you want.
- DaSpudLord
-
Scratcher
1000+ posts
*touching edge* (separating "edge" into four)
Or, maybe something like this.No support for that, sounds complicated for new scratchers and not necessary.
You click the block, then it says “Select Edges”, and you get a diagram of the Stage and you can select which edges you want.
- Steve0Greatness
-
Scratcher
1000+ posts
*touching edge* (separating "edge" into four)
No support for that, sounds complicated for new scratchers and not necessary.I disagree.
You click the block, then it says “Select Edges”, and you get a diagram of the Stage and you can select which edges you want.Oh, so you could do
<touching [top or bottom edge and left edge v] ?>
I think having the opposite ends being selected making it an or would make sense, whereas having the parallel edge selected would make it an and, and if all edges are selected, it'd simply say
<touching [any edge v] ?>
Last edited by Steve0Greatness (June 10, 2024 00:54:42)
- Discussion Forums
- » Suggestions
-
» *touching edge* (separating "edge" into four)















