MonashAlexandria / snapapps

a visual programming language inspired by Scratch
http://snap.berkeley.edu
2 stars 5 forks source link

Cellular HTML5: can't get "distance to" block to work #67

Closed mciotola closed 9 years ago

mciotola commented 9 years ago

Cellular HTML5:

I have been trying to get the ant simulation to work properly. However, I can't get "distance to" block to work. In the desktop sim, it gets pointed to "Sprite 44". However, in the HTML5 version, the block just lets me point "Type 2" (the anthill sprite), mouse or close. Since there is only one anthill, "Type 2" should work fine for this particular sim.

However, all of the ants keep moving to the upper top corner and won't leave. I even sprayed some pheremone to get them to move to the nest (see below, although some of the pheremone has worn off in that image).

cellular_html5_distance-to_block

cellular_html5_distance-to_block

Craxic commented 9 years ago

Hi Mark,

Your images are not working correctly. Would you also be able to provide the project file too (for HTML5 Cellular)?

Thanks, Matt.

mciotola commented 9 years ago

I sent the project file via email. Should I send gif format images instead if png format in the future?

aidanlane commented 9 years ago

Related to #77, but not exactly the same. @Craxic, can you work on #77 first, thanks!

aidanlane commented 9 years ago

Brilliant! In a nutshell, what was the big? Thanks!!

Craxic commented 9 years ago

No big deal, I just had forgotten about these blocks and so they were using the hidden "prototype" sprite for their calculations. Both this block ("point to") and the "distance to" block both use a function called "getOtherObject" to convert an object name to an actual object. So I just moved my changes (from 774f5052f24b59c6b2ec90c3319619c92ce8a387) out of the "distance to" block and into that function instead. Doing it this way, it looks like it'll cover some other bases too.

mciotola commented 9 years ago

Hi guys,

Let me know when this gets deployed. (I tested today, but did not see the change).

Also, will we be able to specify by sprite number, sprite type or just costume type?

Mark

On Tue, Jun 9, 2015 at 4:52 AM, Craxic notifications@github.com wrote:

No big deal, I just had forgotten about these blocks and so they were using the hidden "prototype" sprite for their calculations. Both this block ("point to") and the "distance to" block both use a function called "getOtherObject" to convert an object name to an actual object. So I just moved my changes (from 774f505 https://github.com/aidanlane/snapapps/commit/774f5052f24b59c6b2ec90c3319619c92ce8a387) out of the "distance to" block and into that function instead.

— Reply to this email directly or view it on GitHub https://github.com/aidanlane/snapapps/issues/67#issuecomment-110330152.

aidanlane commented 9 years ago

deployed just now :) be sure to force a refresh in your browser when loading it.

aidanlane commented 9 years ago

Also, will we be able to specify by sprite number, sprite type or just costume type?

Not sure- @Craxic ?

aidanlane commented 9 years ago

No big deal, I just had forgotten about these blocks and so they were using the hidden "prototype" sprite for their calculations.

Ah, thought so :)

Both this block ("point to") and the "distance to" block both use a function called "getOtherObject" to convert an object name to an actual object. So I just moved my changes (from 774f505) out of the "distance to" block and into that function instead. Doing it this way, it looks like it'll cover some other bases too.

Brilliant! Thanks!

mciotola commented 9 years ago

Yes, this works for me now. Thanks!

On Tue, Jun 9, 2015 at 5:25 PM, Aidan Lane notifications@github.com wrote:

deployed just now :) be sure to force a refresh in your browser when loading it.

— Reply to this email directly or view it on GitHub https://github.com/aidanlane/snapapps/issues/67#issuecomment-110543029.

aidanlane commented 9 years ago

Fantastic, thanks @Craxic for getting this working!