Discuss Scratch

Firedrake969
Scratcher
1000+ posts

Smeef!

AonymousGuy wrote:

Firedrake969 wrote:

Looking through the code ( smeef.heliohost.org/Script.js ), I noticed you use the canvas, not jQuery. How hard is it to learn to use the <canvas> tag with JavaScript?
I learned basically how to do it.

Then forgot. So yeah.

But it's pretty simple - there are all sorts of functions for drawing shapes and images and text and etc.
I mean can you detect if two shapes are touching?
AonymousGuy
Scratcher
1000+ posts

Smeef!

Firedrake969 wrote:

AonymousGuy wrote:

Firedrake969 wrote:

Looking through the code ( smeef.heliohost.org/Script.js ), I noticed you use the canvas, not jQuery. How hard is it to learn to use the <canvas> tag with JavaScript?
I learned basically how to do it.

Then forgot. So yeah.

But it's pretty simple - there are all sorts of functions for drawing shapes and images and text and etc.
I mean can you detect if two shapes are touching?
I'm pretty sure - the most rough way would just be comparing the distance between them, which is very possible.
Firedrake969
Scratcher
1000+ posts

Smeef!

AonymousGuy wrote:

Firedrake969 wrote:

AonymousGuy wrote:

Firedrake969 wrote:

Looking through the code ( smeef.heliohost.org/Script.js ), I noticed you use the canvas, not jQuery. How hard is it to learn to use the <canvas> tag with JavaScript?
I learned basically how to do it.

Then forgot. So yeah.

But it's pretty simple - there are all sorts of functions for drawing shapes and images and text and etc.
I mean can you detect if two shapes are touching?
I'm pretty sure - the most rough way would just be comparing the distance between them, which is very possible.
What about rectangles, though? Or triangles? Or weird blobs?
AonymousGuy
Scratcher
1000+ posts

Smeef!

Firedrake969 wrote:

AonymousGuy wrote:

Firedrake969 wrote:

AonymousGuy wrote:

Firedrake969 wrote:

Looking through the code ( smeef.heliohost.org/Script.js ), I noticed you use the canvas, not jQuery. How hard is it to learn to use the <canvas> tag with JavaScript?
I learned basically how to do it.

Then forgot. So yeah.

But it's pretty simple - there are all sorts of functions for drawing shapes and images and text and etc.
I mean can you detect if two shapes are touching?
I'm pretty sure - the most rough way would just be comparing the distance between them, which is very possible.
What about rectangles, though? Or triangles? Or weird blobs?
I said “the most rough way”.

A quick search found this article, it might help.

I just searched “collision detection in canvas” in Google.

Powered by DjangoBB