Coder Social home page Coder Social logo

mobsya / scratch-vm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scratchfoundation/scratch-vm

0.0 0.0 7.0 124.48 MB

Virtual Machine used to represent, run, and maintain the state of programs for Scratch 3.0

Home Page: http://llk.github.io/scratch-vm

License: BSD 3-Clause "New" or "Revised" License

JavaScript 99.63% CSS 0.12% HTML 0.25% Shell 0.01%

scratch-vm's People

Contributors

adroitwhiz avatar apple502j avatar chrisgarrity avatar cwillisf avatar dependabot-preview[bot] avatar ericrosenbaum avatar evhan55 avatar fsih avatar gnarf avatar greenkeeper[bot] avatar griffpatch avatar hyperobject avatar joker314 avatar kchadha avatar kenny2github avatar khanning avatar knandersen avatar ktbee avatar mzgoddard avatar paulkaplan avatar picklesrus avatar pierre-rouanet avatar renovate-bot avatar renovate[bot] avatar rschamp avatar semantic-release-bot avatar thebrokenrail avatar thisandagain avatar tmickel avatar towerofnix avatar

Watchers

 avatar  avatar  avatar

scratch-vm's Issues

turn angle blocks have different way of calculation

also related to #44 different system to calculate time and speed for making angle. very special the non linear part for angle <90. Probably it works for a specific robot.

 turn (angle, callback) {
        angle = parseInt(angle, 10);
        let speed;
        let time;
        if (Math.abs(angle) > 90) {
            speed = 65 * 32 / 10;
            time = Math.abs(angle) * 1.3;
        } else {
            speed = 43 * 32 / 10;
            time = Math.abs(angle) * 2.0;
            time = angle * angle * 2.0 / ((Math.abs(angle) * 1.016) - 0.52); // nonlinear correction
        }

        const args = Array();
        args.push('Q_add_motion');
        args.push(time);
        args.push((angle > 0) ? speed : speed * -1);
        args.push((angle > 0) ? speed * -1 : speed);

       // Send request
       this.requestSendQmotion(args, 2, callback);
    }

  turnWithSpeed (angle, speed, callback) {
       angle = parseInt(angle, 10) * 0.78;
       speed = parseInt(Math.abs(speed), 10);
       speed = parseInt(clamp(speed, Thymio.VMIN * 10 / 32, Thymio.VMAX * 10 / 32), 10);

       if (angle === 0) { 
           const args = [speed * 32 / 10,-speed * 32 / 10]; // speed=10mm/s
           this.sendAction('M_motors', args,callback);
       } else {
           const time = Math.abs(angle) * 100 / speed; // time measured in 100 Hz ticks
           speed = speed * 32 / 10;

           const args = Array();
           args.push('Q_add_motion');
           args.push(time);

           if (angle > 0) {
               args.push(speed);
               args.push(speed * -1);
           } else {
               args.push(speed * -1);
               args.push(speed);
           }

           // Send request
           this.requestSendQmotion(args, 2, callback);
       }
   }
  

is a reset Thymio block needet?

Some block like the set led proximity send command that inactivate the default behaviour of showing the intensity of proximity sensor. That can be problematic if you make a program using it and then pass to a program that do not use it (file new or loading), the default behavior will not be there.

The actual work around is to kit scratch or to shutdown the robot (wait until scratch see that the robot disappear) ,

Another solution is to make a "reset" block that will put the robot in a known state, letting users choose when to reactivate the behavior, is that needed?

Scratch 3 odometer need rework on initialisation & intuitivity

I tried the Odometer block which has three parameters Direction, X and Y.

The Direction is odd. If you use the Set odometer block and put a value as init, the value of the odometer Angle block will be 1 or 2 below the init value and then, as soon as you rotate with the motors, the value jumps. I tried the following:

Set value: 0 => read value 176
Set value: 50 => read value 126
Set value 100 => read value 76
Set value 200 => read value -24

Then, it seems that the 0 value of the direction makes the robot face the minus Y axis. In my opinion, it would be more intuitive to have the robot face the + X values.
image

The value of the Direction is defined on a range of -90 to 280 which I also find strange. If you just rotate and look at the values you get, it's like that. I would suggest either to have a 0 to 360 or -180 to 180.

Finally on the X and Y axes, the units are strange. On the general other blocks like "move ()" or the speed, we use mm or mm/s. Here is just a coupe of measures I did:

10 units of odometer => ~5.5 cm
20 units of odometer => ~11cm

Should we use the same ~mm units we use for the rest, especially for the "move ()"? Otherwise, it will be very hard to use this odometer block.

Operating System and Browser

Windows 8.1, Version Thymio Suite Beta 2 online on thymio.org (2.0.0-350ce8fc BETA)

infinite loop without a wait create chaos

infinite repeate are making to much http request
it is working with putting a wait 0 sec

if we can improve that with actual web bridge would be great, otherwise we have to wait TDM

leds buttons

the function is working but then it is overwrited by the motion control step

Translations

upstream uses transifex to translates scratch

I suggest we do the same

Rough idea:

  • 1 In the code, use https://www.npmjs.com/package/format-message (as the rest of scratch) to format translatable text
  • Modify package.json to extract thymio-specific in a separate files
  • Create an account transifex or similar service
  • Push the generated file on said service
  • translate...
  • sync trads

Uncaught TypeError: this.cachedValues.get(...).slice is not a function

I stumbled upon the following error which makes scratch unusable for me

Uncaught TypeError: this.cachedValues.get(...).slice is not a function
    at Thymio.touchVal (lib.min.js:303246)
    at Thymio.notouching (lib.min.js:303278)
    at Scratch3ThymioBlocks.notouching (lib.min.js:304755)
    at execute (lib.min.js:289860)
    at Sequencer.stepThread (lib.min.js:293454)
    at Sequencer.stepThreads (lib.min.js:293356)
    at Runtime._step (lib.min.js:292110)
    at lib.min.js:292759

Scratch 3 Sprite screen bugged

Expected Behavior

I was programming something, displaying some variable on the Sprite screen (where there is the cat) and suddenly the screen blue-screened as below

Actual Behavior

image
I tried to go full screen to press the refresh button but it did not work. Loading a new program, a blank one or changing the language didn't fix the problem. Reloading Scratch completely fixed the issue.

Steps to Reproduce

Apparently these specific things don't work:
image
image
image
image

These work fine:
image
image
image

It's really when you press the refresh button that the sprite zone go blue-screen:
image

Operating System and Browser

Windows 8.1, Version Thymio Suite Beta 2 online on thymio.org (2.0.0-350ce8fc BETA)

Test report Scratch 1st of Oct. 18

I tested a few things on a Windows 8.1 machine, Chrome, Wireless Thymio and classic Thymio:

  1. When connecting to the Thymio extension, the forward or left arrow LED is always lit on. It does that on Wireless and classic Thymio. Sometimes it's the forward, sometimes the left. It's really when the scratch extension connects to Thymio not the web bridge or anything else. Some LEDs blink (like the circle ones) and then, one of the button LED lights on and stays like that.
    I found a funny thing with that. If you just use this block:
    image
    and click on it, the button LED that is next to the one always lit light up a bit (like half of power) and when the motors are stopping the LED that was lit turns off and the one that was half lit lights up completely. It does some sort of a circle, one LED after the other.
    You can also do that with this block:
    image

  2. Leds clear => doesn't clear the horizontal sensors LEDs

  3. leds buttons => just blink and does not stay as you ask. Doesn't fix the constant lit on LED either

  4. Should we add a "is pressed" at the end of the button event?
    image

  5. While using a Wireless Thymio, some commands are sent but are not executed by the robot. Doesn't happen with classic Thymio. I did this simple program:
    image
    and saw a ~10% time failure on one of the two motors. Also happens if you just command one motor, sometimes it doesn't stop or doesn't turn on.
    it's problematic on some occasion such as this one:
    image
    The robot just stops after X movements and doesn't go back in the loop. I tried with all the three channels and the problem occurs in each three of them. Sometimes it's after 5 loops, sometimes, you can do 20, but in the end, it always stops.

  6. With the "turn X° in Y sec", you can put negative time and it seems to do the same thing as positive time:
    image

image
Couldn't we block some values? Like only positive? Just do some sort of absolute value?
Same thing with smaller than 0 values. For example, I program my robot to turn 90° in 3 seconds:
image
It works nicely. Then I decide to go much faster and put 0.5 seconds instead:
image
And it does the 3 seconds one. Even if I change the value of the angle, the robot does the same thing all over again. It's only when I put back a bigger than 1 value that it does what I want. But I get no warning or anything.

One good point is that the connection is much more stable than before and the delay between orders and execution is much smaller (I had around 10-15ms max)

improve make circle bloc

ne peut pas faire de rayon plus petit que la distance entre les roues (~10cm) car si on met un petit rayon, on arrête une roue et fait avancer l'autre.
Est-ce qu'on peut modifier le code généré par le bloc pour faire des plus petits rayons ? (typiquement une roue en marche avant, une en marche arrière) C'est notamment intéressant si on veut faire des dessins genre spirographes.

Delete multiple blocks not working

Expected Behavior

When multiple blocks are on the work area I select them and I can move them together. When I press the right button on the mouse a pop-up window menu opens and I select to delete all the blocks selected. I expect the blocks to be deleted.

Actual Behavior

The blocks are not deleted

Steps to Reproduce

put any block into the work area. Select 2 or more blocks. Right clic on the mouse. Press delete N blocks (where N is the number of blocks you selected) and you see that nothing is done.

Operating System and Browser

Mac OSX High Sierra 10.13.6 - Firefox Quantum 66.0.3

is a temperature block needet

one of the useless information that Thymio can provide is its internal temperature, should we make a block for it?

File New not working on MAC OSX - Firefox

Expected Behavior

When I have created a program in Scratch 3 I want to start a new program and delete all the blocks on the work area I press File -> New and I expect to see a new blank work area

Actual Behavior

No action. Nothing happens.

Steps to Reproduce

Put any block on the work area. Then press the menu FILE and then New and nothing happens.

Operating System and Browser

Mac OS High Sierra Version 10.13.6 - Firefox Quantum 66.0.3 64 bit

leds clear do not clears sensor h

we can discuss it because i would expect that it does is but it is not done to keep the normal behavior of pulsing with the sensor when user do nothing with them

add sound stop recording

actual bloc only start sound recording with a number as parameter (should be positive)
add a stop recording bloc (send -1 as value)

Save and Open file on Mac seems not to work

I had a phone call with a Scratch beta user and he told me that on Mac OS, the save and open file features are not working. As I don't have a Mac, difficult to check. Is it already known?

icon is double on the left

Expected Behavior

Please describe what should happen

Actual Behavior

Describe what actually happens
image

Operating System and Browser

_e.g. Win 10 Chhrome 69.0.3497.92 (Build officiel)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.