Came up with the best ideas yesterday:
Go to Edge (based on direction)
Point towards X:( ) Y:( )
That one can be used for car games, or *cough* tower defense games or somethin........
I really think these ideas could be useful. Any comments Scratch Team?
Last edited by Cyclone103 (2008-08-18 11:24:52)
Offline
Interesting ideas Cyclone103-
We are always looking for ways to improve Scratch and often look for ideas proposed by the community. While we can't promise we will be able to honor every request, we will certainly consider your ideas for future releases of Scratch.
In the meantime, here is a little trick to simulate the point to x, y block you suggested:
- First create a placeholder sprite like a tiny dot, the same color as a background.
- Place this placeholder sprite at the exact x,y coordinate that you want to make another sprite point towards
- Then, use the block: point towards [placeholder sprite name]
Offline
I know, that was the only way to do it. My idea however, assuming lists are incorporated into 1.3, would allow for a list to hold all of the positions. It is sorta hard to explain, since I can't show you with list block pictures, but it could be used to set a "waypoint" for an enemy sprite (in a tower defense game) to point to, and have it move until it hits that point, and points to the next. Just an idea.
Offline
I would have to create a waypoint sprite for each and every enemy in your example, cause some enemies are ahead of teh point, and some are behind. I wonder if I could use a very quick broadcast system.........
Offline
mletreat wrote:
Interesting ideas Cyclone103-
We are always looking for ways to improve Scratch and often look for ideas proposed by the community. While we can't promise we will be able to honor every request, we will certainly consider your ideas for future releases of Scratch.
In the meantime, here is a little trick to simulate the point to x, y block you suggested:
- First create a placeholder sprite like a tiny dot, the same color as a background.
- Place this placeholder sprite at the exact x,y coordinate that you want to make another sprite point towards
- Then, use the block: point towards [placeholder sprite name]
That's one way to do it, but there's another way that doesn't involve making any more sprites.
Create 5 variables, in this example x dir, y dir, angle, input1, and input2.
[blocks]
<set{ x dir }to( (( <{ input1 }> <-> <x position> ))
<set{ y dir }to( (( <{ input2 }> <-> <y position> ))
<set{ angle }to( acos of (( <{ ydir }> </> sqrt of (( (( <{ x dir }> <*> <{ x dir }> )) <+> (( <{ y dir }> <*> <{ y dir }> )) )) ))
<if> <( x dir <<> 0 )>
<set{ angle }to( (( <{ angle }> <*> -1 ))
<end>
<point in direction( <{ angle }>
[/blocks]
It works, but it's a bit messy, and it doesn't work if the two inputs are equal to the sprite's position. [blocks] <{ input1 }> [/blocks] and [blocks] <{ input2 }> [/blocks] are the inputs.
Last edited by rubiks_cube_guy238 (2009-08-06 12:26:01)
Offline
Go to [Edge] can be done by this:
..................
[repeat until touching [edge]]
[move (your choice) steps]
Offline
Offline
Okay, yes they are pretty good block ideas but both of them I know how to get. Here they are:
Point to x: [] y: []: Ok this block is REALLY easy to get. Follow this link http://scratch.mit.edu/projects/TheoMarr/613160 and you'll know how to get it
Go to edge: I'm sorry, but I don't know how to get it in source code. But there is a way of making it, which is quite complicated, but I'll tell you anyway:
First of all, open the Scratch 1.4 with the Scratch 1.1 block "point away from edge". Now, below it, use the following blocks:
[blocks]<point in direction( (( <direction> <*> -1 ))[/blocks]
[blocks]<repeat until><touching[ edge[/blocks]
[blocks]<move( Whatever )steps>[/blocks]
[blocks]<end>[/blocks]
That should give you the go to edge block!
Last edited by TheoMarr (2009-08-07 08:56:26)
Offline
You could make this with somthing based off scratch called BYOB
Offline
<move( <{ Num }> )steps><wait until><touching[ Edge
Offline
mletreat wrote:
Interesting ideas Cyclone103-
We are always looking for ways to improve Scratch and often look for ideas proposed by the community. While we can't promise we will be able to honor every request, we will certainly consider your ideas for future releases of Scratch.
In the meantime, here is a little trick to simulate the point to x, y block you suggested:
- First create a placeholder sprite like a tiny dot, the same color as a background.
- Place this placeholder sprite at the exact x,y coordinate that you want to make another sprite point towards
- Then, use the block: point towards [placeholder sprite name]
How the heck are you a Member??
Offline
ESN wrote:
mletreat wrote:
Interesting ideas Cyclone103-
We are always looking for ways to improve Scratch and often look for ideas proposed by the community. While we can't promise we will be able to honor every request, we will certainly consider your ideas for future releases of Scratch.
In the meantime, here is a little trick to simulate the point to x, y block you suggested:
- First create a placeholder sprite like a tiny dot, the same color as a background.
- Place this placeholder sprite at the exact x,y coordinate that you want to make another sprite point towards
- Then, use the block: point towards [placeholder sprite name]How the heck are you a Member??
Well, this topic is two years old. He posted that when the status was 'Member', not 'Scratcher', and it just never got changed to the new rank. (Probably because he may not have posted since then)
P.S. Epic necropost on the part of supergarfield!
Last edited by Harakou (2010-12-09 23:16:17)
Offline