Discuss Scratch

Gato_Amigo111
Scratcher
500+ posts

How do You Make Mobile Projects?

A lot of scratchers have been asking for some of my more famous projects to be mobile-friendly. How should I go about doing this?

when green flag clicked
Make it Mobile
Dragonspire77
Scratcher
500+ posts

How do You Make Mobile Projects?

Since mobile devices don't have a keyboard, you'd have to base your code around the mouse pointer, whether it's down or not, and its position on the screen.
Gato_Amigo111
Scratcher
500+ posts

How do You Make Mobile Projects?

Dragonspire77 wrote:

Since mobile devices don't have a keyboard, you'd have to base your code around the mouse pointer, whether it's down or not, and its position on the screen.
Oh, I see. Thanks!
R_Ravenclaw
Scratcher
100+ posts

How do You Make Mobile Projects?

Dragonspire77 wrote:

you'd have to base your code around the mouse pointer, whether it's down or not, and its position on the screen.

Not exactly, remember that mobile devices don't have a mouse pointer, they can only detect clicks.

So basically you's have to switch out these:

<key [any v] pressed?>
when [any v] key pressed
(mouse x)
(mouse y)
<touching [mouse pointer v] ?>

since they all use the keyboard or mouse. You'd probably have to replace them with buttons on the screen, and use

when this sprite clicked
Nezon
Scratcher
1000+ posts

How do You Make Mobile Projects?

R_Ravenclaw wrote:

Dragonspire77 wrote:

you'd have to base your code around the mouse pointer, whether it's down or not, and its position on the screen.

Not exactly, remember that mobile devices don't have a mouse pointer, they can only detect clicks.

So basically you's have to switch out these:
(mouse x)
(mouse y)
<touching [mouse pointer v] ?>

since they all use the keyboard or mouse. You'd probably have to replace them with buttons on the screen, and use

when this sprite clicked
mouse x, y, and touching mouse pointer all work
ScratchCat1038
Scratcher
1000+ posts

How do You Make Mobile Projects?

On mobile, Scratch senses the finger as the mouse, so many Scratchers either make a character go towards the mouse (in platformers) or have a joystick (in other games).
R_Ravenclaw
Scratcher
100+ posts

How do You Make Mobile Projects?

Nezon wrote:

R_Ravenclaw wrote:

Dragonspire77 wrote:

you'd have to base your code around the mouse pointer, whether it's down or not, and its position on the screen.

Not exactly, remember that mobile devices don't have a mouse pointer, they can only detect clicks.

So basically you's have to switch out these:
(mouse x)
(mouse y)
<touching [mouse pointer v] ?>

since they all use the keyboard or mouse. You'd probably have to replace them with buttons on the screen, and use

when this sprite clicked
mouse x, y, and touching mouse pointer all work

Sorry I didn't explain myself very well. Yes they work, but mobile would only detect it if the user touches the screen, not all the time. So for example, hovering effects & mouse trails wouldn't work well. And it may mess up some projects: say you have a slideshow type project that advances with clicks, and also a mouse trail. The mouse trail would only work on mobile if the user is touching the screen at all times, which would play slide after slide.

So I guess what I wanted to say is that they wouldn't work in the same way and it's important to consider that

Powered by DjangoBB