This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
starting:scratch2gp2 [2017/09/30 10:34] simplesi [Actual GP Version] |
starting:scratch2gp2 [2017/09/30 17:27] (current) simplesi |
||
---|---|---|---|
Line 7: | Line 7: | ||
It is available for Windows,Mac and Linux from https://gpblocks.org/ | It is available for Windows,Mac and Linux from https://gpblocks.org/ | ||
- | There is also a version running on a web server so it can be tried out with any browser also (lacks a few features so better to download and run if possible) | + | There is also a [[https://gpblocks.org/run/gp.html|version]] running on a web server so it can be tried out without having to install anything |
===== 1st Impressions ===== | ===== 1st Impressions ===== | ||
Line 56: | Line 56: | ||
Note: You can right-click on the {{:blocks:i.png|}} and give it nice name if you want | Note: You can right-click on the {{:blocks:i.png|}} and give it nice name if you want | ||
- | ==== Moving a sprite/class around ==== | + | ===== Moving a sprite/class around ===== |
TWO MAJOR DIFFERENCES BETWEEN //Scratch// AND **GP** | TWO MAJOR DIFFERENCES BETWEEN //Scratch// AND **GP** | ||
Line 82: | Line 82: | ||
So //in Scratch we are looping until the count is bigger than 10//, **in GP we loop while the count less than 11** | So //in Scratch we are looping until the count is bigger than 10//, **in GP we loop while the count less than 11** | ||
- | === Forever === | ||
^ Scratch ^ GP ^ | ^ Scratch ^ GP ^ | ||
- | | | | | + | | {{:starting:scratch2gp:scr_forevercount.gif|}} | {{:starting:scratch2gp:gp_animatecount.png|}} \\ This is direct replacement.\\ It will loop forever and wait for screen to\\ refresh between each loop so you\\ don’t get any flicker | |
- | | This is direct replacement – it will loop forever and wait for screen to refresh between each loop so you don’t get any flicker | This will do same as above but is “better” GP way of doing it. The while is always true and the wait waits for the screen to refresh | | + | | | {{:starting:scratch2gp:gp_whilewaitcount.png|}} \\ Alternatively, we could use a while loop\\ with an added wait at the end\\ which will work exactly the same way | |
- | Fastest way to loop forever without waiting for screen refreshes | + | === If and If/Else === |
- | If and If/Else | + | |
- | Scratch GP | + | |
- | + | ^ Scratch ^ GP ^ | |
- | + | | {{:starting:scratch2gp:sct_if-1.gif|}} | {{:starting:scratch2gp:gp_if-1.png|}} | | |
- | + | | {{:starting:scratch2gp:scr_ifelse.gif|}} | {{:starting:scratch2gp:gp_ifelse-4.png|}} | | |
GP uses one combined if block instead of Scratch’s two types. It can be changed from if to if/else by simply clicking on the black arrow | GP uses one combined if block instead of Scratch’s two types. It can be changed from if to if/else by simply clicking on the black arrow | ||
- | GPs if/elseif block is much more powerful than the simple example above and can save a lot of nested if statements which leads to your code being easier to read and debug 🙂 | + | GPs if/elseif block is much more powerful than the simple example above and can save a lot of nested if statements which leads to your code being easier to read and debug |
==== Graphics ==== | ==== Graphics ==== | ||
Line 106: | Line 104: | ||
The one thing that is the same is the Pen category that lets your draw over the screen just as in Scratch. | The one thing that is the same is the Pen category that lets your draw over the screen just as in Scratch. | ||
- | One major change is that there is no actual Stage (Scratch 1.4) or Background (Scratch 2). So if you want a background image you create a big costume (GP screen size is 800 x 600 unlike Scratch’s 480×360) and just don’t move it around | + | === Stage/Background === |
+ | |||
+ | There is no actual Stage (Scratch 1.4) or Background (Scratch 2). | ||
+ | |||
+ | But you can easily simulate this by creating a class with a big costume (GP screen size is 800 x 500 unlike Scratch’s 480×360) and just don’t move it around. | ||
+ | |||
+ | === Costumes === | ||
GP only comes with 2 images (the Ship and the GP one) but you can load in any .png image and set the instances costume to it very easily. | GP only comes with 2 images (the Ship and the GP one) but you can load in any .png image and set the instances costume to it very easily. | ||
- | I have converted all the Scratch 1.4 images to .png and re-sized the background ones to be 800×500. The zipped file of these images is available here. I believe the Scratch Creative Commons Attribution-ShareAlike 2.0 license allows them to be used in GP but if anyone knows differently, please let me know | + | Simon Walters has converted all the Scratch 1.4 images to .png and re-sized the background ones to be 800×500. The zipped file of these images is available here. |
+ | |||
+ | ==== Other notable differences ==== | ||
+ | |||
+ | === Timer === | ||
+ | |||
+ | The timer counts up in milliiseconds (thousanths of seconds) and there is no reset timer block. So you have to set a variable, say starttime, to timer value and then subtract the timer from your starttime and divide it by 1000 to get the time difference in seconds. | ||
- | Other notable differences | + | === Touching === |
- | The timer counts up in milliiseconds (thousanths of seconds) and there is no reset timer block. So you have to set a variable, say starttime, to timer value and then subtract the timer from your starttime and divide it by 1000 to get the time difference in seconds | + | |
- | There is no touching colour or touching edge 🙁 You can only detect touching a class or the mouse) There are complex ways around this but much easier/better to just re-think approaches to coding. | + | There is no touching colour or touching edge. You can only detect touching a class or the mouse) |