Discuss Scratch
- Discussion Forums
- » Suggestions
- » *touching edge* (separating "edge" into four)
- _Hope
-
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
-
100+ posts
*touching edge* (separating "edge" into four)
Maybe instead of right, left, top, bottom, maybe try these: Right now, we have<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
-
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
-
100+ posts
*touching edge* (separating "edge" into four)
Note: I am not proposing the removal of <touching edge?>. (now specified in suggestion) Right now, we have<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
-
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
-
1000+ posts
*touching edge* (separating "edge" into four)
Not always. 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

<<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
-
500+ posts
*touching edge* (separating "edge" into four)
shoot, i forgot. you need to define the value based on costume width (assuming costume is centered logically, otherwise you might need offset) Not always.
~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
-
500+ posts
*touching edge* (separating "edge" into four)
I support and thing that “top edge, right edge, etc.” is fine.
- Pot-of-Gold
-
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
-
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
-
1000+ posts
*touching edge* (separating "edge" into four)
Support for this. 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.
- DaSpudLord
-
1000+ posts
*touching edge* (separating "edge" into four)
No support for that, sounds complicated for new scratchers and not necessary. 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.
- Steve0Greatness
-
1000+ posts
*touching edge* (separating "edge" into four)
I disagree. No support for that, sounds complicated for new scratchers and not necessary.
Oh, so you could do 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.
<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)