Can a Morph / (etoys player) follow a connector path ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Can a Morph / (etoys player) follow a connector path ?

mstram
I'd like to do something similar to this game in Squeak / Etoys

http://www.gamenet.com/game/air-traffic-chief/

I.e. using a connector, having the motion of a morph follow that
connector, as the connector is moved while the morph is moving.

I see the demos in Etoys of   a "car following a road", but they seem
to be tracking a particular color, and continually turning left or
right (which is ya, basically what any path finding program is gonna
have to do internally, I guess).

Wondering if there is a "high level"  / class  / etoys .. method etc,
to track a connector

Mike
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Can a Morph / (etoys player) follow a connector path ?

Steve Thomas
Mike,

No high level method I know of to track a connector. But there are many wonderful things inside Etoys which I have not yet discovered.

So lets break down the game a bit.  You have to detect clicking on a particular plane (this can be done setting a script for each plane to execute on a mouse down event).
Then you have to "draw a path to the target" and that path is not always a straight line.
And you have to make sure the plane you clicked follows the path you drew for it, not another planes path (assuming you are making a multi-plane game).

Well lets start simple with a single plane version.

First let's assume only a plane and target.  When you click on the plane you can get a script to execute by setting the scripts "when to run" to "Mouse down" (in the script editor, click on normal and you will get a list of options).
Inline image 1

Now once you click on the script you would need to start "drawing the path"
One way to do this would be to create a copy of a "marker" (pick any object you want to use as your marker) and have it follow your mouse movements.  For the script below I created my plane on the page of a book (I like doing this as I can duplicate pages for different versions as I play and explore).  The script below was started with the "mouse down" on the plane from the script above.

Inline image 2

Then when you click again you would want to stop the marker from following the mouse.
Inline image 3

Now of course you would need to create copies of these markers and keep track of them for each plane (a holder would be a good way to keep track of them). And to show the path you could use connectors connecting your plane to the markers. 

There are a number of more "advanced" Etoys features you would need to use but if you can play around with the above and want to go further, please send more questions to the list and we'll be glad to help.

Stephen

On Fri, Mar 16, 2012 at 1:09 PM, Mike Stramba <[hidden email]> wrote:
I'd like to do something similar to this game in Squeak / Etoys

http://www.gamenet.com/game/air-traffic-chief/

I.e. using a connector, having the motion of a morph follow that
connector, as the connector is moved while the morph is moving.

I see the demos in Etoys of   a "car following a road", but they seem
to be tracking a particular color, and continually turning left or
right (which is ya, basically what any path finding program is gonna
have to do internally, I guess).

Wondering if there is a "high level"  / class  / etoys .. method etc,
to track a connector

Mike
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland


_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Can a Morph / (etoys player) follow a connector path ?

Harness, Kathleen
In reply to this post by mstram
Hi Mike,
I see Steve's note and it has some very good ideas. This attachment is a flight path project I started a few months ago. Here it is, not quite finished but you can see what is going on.
Regards,
Happy Landings
Kathleen
________________________________________
From: [hidden email] [[hidden email]] on behalf of Mike Stramba [[hidden email]]
Sent: Friday, March 16, 2012 3:09 PM
To: [hidden email]
Subject: [squeakland] Can a Morph / (etoys player) follow a connector path ?

I'd like to do something similar to this game in Squeak / Etoys

http://www.gamenet.com/game/air-traffic-chief/

I.e. using a connector, having the motion of a morph follow that
connector, as the connector is moved while the morph is moving.

I see the demos in Etoys of   a "car following a road", but they seem
to be tracking a particular color, and continually turning left or
right (which is ya, basically what any path finding program is gonna
have to do internally, I guess).

Wondering if there is a "high level"  / class  / etoys .. method etc,
to track a connector

Mike
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland

_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland

A pathfinder.014.pr (128K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can a Morph / (etoys player) follow a connector path ?

Steve Thomas
See I told you there were lots of wonderful things inside Etoys I still need to discover!!!

I'll add <draw new path> and <follow path> to the list.

Thanks Kathleen!!!

On Fri, Mar 16, 2012 at 5:39 PM, Harness, Kathleen <[hidden email]> wrote:
Hi Mike,
I see Steve's note and it has some very good ideas. This attachment is a flight path project I started a few months ago. Here it is, not quite finished but you can see what is going on.
Regards,
Happy Landings
Kathleen
________________________________________
From: [hidden email] [[hidden email]] on behalf of Mike Stramba [[hidden email]]
Sent: Friday, March 16, 2012 3:09 PM
To: [hidden email]
Subject: [squeakland] Can a Morph / (etoys player) follow a connector path ?

I'd like to do something similar to this game in Squeak / Etoys

http://www.gamenet.com/game/air-traffic-chief/

I.e. using a connector, having the motion of a morph follow that
connector, as the connector is moved while the morph is moving.

I see the demos in Etoys of   a "car following a road", but they seem
to be tracking a particular color, and continually turning left or
right (which is ya, basically what any path finding program is gonna
have to do internally, I guess).

Wondering if there is a "high level"  / class  / etoys .. method etc,
to track a connector

Mike
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland

_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland



_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Can a Morph / (etoys player) follow a connector path ?

K K Subbu
In reply to this post by mstram
On Saturday 17 Mar 2012 1:39:33 AM Mike Stramba wrote:
> I'd like to do something similar to this game in Squeak / Etoys
>
> http://www.gamenet.com/game/air-traffic-chief/
>
> I.e. using a connector, having the motion of a morph follow that
> connector, as the connector is moved while the morph is moving.
You could use a polygon object (open) for the path and add a variable to the
plane that tracks the current vertex cursor and moves along the vertices of
the polygon.

See the tiles in Polygon->polygon category for adding new vertices at the
beginning and removing vertices at the end.

HTH .. Subbu
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Can a Morph / (etoys player) follow a connector path ?

Karl Ramberg
In reply to this post by Steve Thomas
I made a version of this here
http://squeakland.org/showcase/project.jsp?id=11816 

Click in the green playfields to create markers.

Start the plane with the Go button

Karl

On Fri, Mar 16, 2012 at 10:24 PM, Steve Thomas <[hidden email]> wrote:
Mike,

No high level method I know of to track a connector. But there are many wonderful things inside Etoys which I have not yet discovered.

So lets break down the game a bit.  You have to detect clicking on a particular plane (this can be done setting a script for each plane to execute on a mouse down event).
Then you have to "draw a path to the target" and that path is not always a straight line.
And you have to make sure the plane you clicked follows the path you drew for it, not another planes path (assuming you are making a multi-plane game).

Well lets start simple with a single plane version.

First let's assume only a plane and target.  When you click on the plane you can get a script to execute by setting the scripts "when to run" to "Mouse down" (in the script editor, click on normal and you will get a list of options).
Inline image 1

Now once you click on the script you would need to start "drawing the path"
One way to do this would be to create a copy of a "marker" (pick any object you want to use as your marker) and have it follow your mouse movements.  For the script below I created my plane on the page of a book (I like doing this as I can duplicate pages for different versions as I play and explore).  The script below was started with the "mouse down" on the plane from the script above.

Inline image 2

Then when you click again you would want to stop the marker from following the mouse.
Inline image 3

Now of course you would need to create copies of these markers and keep track of them for each plane (a holder would be a good way to keep track of them). And to show the path you could use connectors connecting your plane to the markers. 

There are a number of more "advanced" Etoys features you would need to use but if you can play around with the above and want to go further, please send more questions to the list and we'll be glad to help.

Stephen

On Fri, Mar 16, 2012 at 1:09 PM, Mike Stramba <[hidden email]> wrote:
I'd like to do something similar to this game in Squeak / Etoys

http://www.gamenet.com/game/air-traffic-chief/

I.e. using a connector, having the motion of a morph follow that
connector, as the connector is moved while the morph is moving.

I see the demos in Etoys of   a "car following a road", but they seem
to be tracking a particular color, and continually turning left or
right (which is ya, basically what any path finding program is gonna
have to do internally, I guess).

Wondering if there is a "high level"  / class  / etoys .. method etc,
to track a connector

Mike
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland


_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland



_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Can a Morph / (etoys player) follow a connector path ?

Harness, Kathleen
Hi Karl,
First, thanks for all your work you making this new release!

Thanks for the example project idea. It is very nice. One of the things that first interested me in Etoys was that it would carry ideas in many ways and would be difficult for children to outgrow. Whenever I see expert examples, I realize again how deep it is and how fine.
Regards,
Kathleen

From: [hidden email] [[hidden email]] on behalf of karl ramberg [[hidden email]]
Sent: Sunday, March 18, 2012 7:35 AM
To: Steve Thomas
Cc: [hidden email]
Subject: Re: [squeakland] Can a Morph / (etoys player) follow a connector path ?

I made a version of this here
http://squeakland.org/showcase/project.jsp?id=11816 

Click in the green playfields to create markers.

Start the plane with the Go button

Karl

On Fri, Mar 16, 2012 at 10:24 PM, Steve Thomas <[hidden email]> wrote:
Mike,

No high level method I know of to track a connector. But there are many wonderful things inside Etoys which I have not yet discovered.

So lets break down the game a bit.  You have to detect clicking on a particular plane (this can be done setting a script for each plane to execute on a mouse down event).
Then you have to "draw a path to the target" and that path is not always a straight line.
And you have to make sure the plane you clicked follows the path you drew for it, not another planes path (assuming you are making a multi-plane game).

Well lets start simple with a single plane version.

First let's assume only a plane and target.  When you click on the plane you can get a script to execute by setting the scripts "when to run" to "Mouse down" (in the script editor, click on normal and you will get a list of options).
Inline image 1

Now once you click on the script you would need to start "drawing the path"
One way to do this would be to create a copy of a "marker" (pick any object you want to use as your marker) and have it follow your mouse movements.  For the script below I created my plane on the page of a book (I like doing this as I can duplicate pages for different versions as I play and explore).  The script below was started with the "mouse down" on the plane from the script above.

Inline image 2

Then when you click again you would want to stop the marker from following the mouse.
Inline image 3

Now of course you would need to create copies of these markers and keep track of them for each plane (a holder would be a good way to keep track of them). And to show the path you could use connectors connecting your plane to the markers. 

There are a number of more "advanced" Etoys features you would need to use but if you can play around with the above and want to go further, please send more questions to the list and we'll be glad to help.

Stephen

On Fri, Mar 16, 2012 at 1:09 PM, Mike Stramba <[hidden email]> wrote:
I'd like to do something similar to this game in Squeak / Etoys

http://www.gamenet.com/game/air-traffic-chief/

I.e. using a connector, having the motion of a morph follow that
connector, as the connector is moved while the morph is moving.

I see the demos in Etoys of   a "car following a road", but they seem
to be tracking a particular color, and continually turning left or
right (which is ya, basically what any path finding program is gonna
have to do internally, I guess).

Wondering if there is a "high level"  / class  / etoys .. method etc,
to track a connector

Mike
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland


_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland



_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Can a Morph / (etoys player) follow a connector path ?

Karl Ramberg
Thank you for all your work.

Etoys are quite amazing in the amount of possibilities. 
One hard part is to match Etoys abilities to the project at hand. 
I often have to remake a project several times to get it right.
Etoys have a steep learning curve and not always forgiving. 
But we are working on it :-)

And as you say, Etoys are hard to outgrow. 

Karl

On Sun, Mar 18, 2012 at 2:23 PM, Harness, Kathleen <[hidden email]> wrote:
Hi Karl,
First, thanks for all your work you making this new release!

Thanks for the example project idea. It is very nice. One of the things that first interested me in Etoys was that it would carry ideas in many ways and would be difficult for children to outgrow. Whenever I see expert examples, I realize again how deep it is and how fine.
Regards,
Kathleen

From: [hidden email] [[hidden email]] on behalf of karl ramberg [[hidden email]]
Sent: Sunday, March 18, 2012 7:35 AM
To: Steve Thomas
Cc: [hidden email]
Subject: Re: [squeakland] Can a Morph / (etoys player) follow a connector path ?

I made a version of this here
http://squeakland.org/showcase/project.jsp?id=11816 

Click in the green playfields to create markers.

Start the plane with the Go button

Karl

On Fri, Mar 16, 2012 at 10:24 PM, Steve Thomas <[hidden email]> wrote:
Mike,

No high level method I know of to track a connector. But there are many wonderful things inside Etoys which I have not yet discovered.

So lets break down the game a bit.  You have to detect clicking on a particular plane (this can be done setting a script for each plane to execute on a mouse down event).
Then you have to "draw a path to the target" and that path is not always a straight line.
And you have to make sure the plane you clicked follows the path you drew for it, not another planes path (assuming you are making a multi-plane game).

Well lets start simple with a single plane version.

First let's assume only a plane and target.  When you click on the plane you can get a script to execute by setting the scripts "when to run" to "Mouse down" (in the script editor, click on normal and you will get a list of options).
Inline image 1

Now once you click on the script you would need to start "drawing the path"
One way to do this would be to create a copy of a "marker" (pick any object you want to use as your marker) and have it follow your mouse movements.  For the script below I created my plane on the page of a book (I like doing this as I can duplicate pages for different versions as I play and explore).  The script below was started with the "mouse down" on the plane from the script above.

Inline image 2

Then when you click again you would want to stop the marker from following the mouse.
Inline image 3

Now of course you would need to create copies of these markers and keep track of them for each plane (a holder would be a good way to keep track of them). And to show the path you could use connectors connecting your plane to the markers. 

There are a number of more "advanced" Etoys features you would need to use but if you can play around with the above and want to go further, please send more questions to the list and we'll be glad to help.

Stephen

On Fri, Mar 16, 2012 at 1:09 PM, Mike Stramba <[hidden email]> wrote:
I'd like to do something similar to this game in Squeak / Etoys

http://www.gamenet.com/game/air-traffic-chief/

I.e. using a connector, having the motion of a morph follow that
connector, as the connector is moved while the morph is moving.

I see the demos in Etoys of   a "car following a road", but they seem
to be tracking a particular color, and continually turning left or
right (which is ya, basically what any path finding program is gonna
have to do internally, I guess).

Wondering if there is a "high level"  / class  / etoys .. method etc,
to track a connector

Mike
_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland


_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland




_______________________________________________
squeakland mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/squeakland