This is an old revision of the document!
In this tutorial GP concepts and words will be shown in bold, and Scratch concepts and words will be shown in italics
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)
The screen is different in layout to Scratch but has the same basic areas.
Top left are block categories – next is blocks within category – scripts go bottom left – the stage is on the right.
(GP draws a dotted line to sprites – just click show arrows at top right to switch this off)
Below the stage are the classes and instances – just don’t worry about these names for the moment and treat them as being same as sprites i.e if you want a new sprite – click on Classes +
(Instances + is like Scratch 2 cloning to create a copy of a sprite so just leave that alone for moment)
(If you do press Instances + by mistook, then you can easily get rid of them by pressing Clear button on the right)
There are only 2 inbuilt costumes – one called ship and another one called GP.
But you can load any .png type file by clicking on Images tab and selecting Add Images From File.
Instances only have one costume but you can modify it (or draw your own) using the blocks in the Drawing and Pixels categories
There is a simple example of building a little project here
Lets make a simple project in both Scratch and GP to count to 10
So main differences were:
When Green Flag click == when I receive go
There is no in GP so we always have to add in own own wait block
Now although we can write nearly the exactly same code in GP compared to Scratch, GP has far more programming tools so this is the actual way of doing this in GP | ![]() |
These for loops are present in nearly all programming languages (Scratch being a notable exception) so they are well worth getting to know as it saves having to create a variable to keep track of the count and having to have a block to increase it inside of the loop.
Note: You can right-click on the and give it nice name if you want
TWO MAJOR DIFFERENCES BETWEEN Scratch AND GP
There is no in GP – it has been replaced by
Consider these two scripts
So in Scratch repeat until will loop until something becomes true but in GP the while will loop while something is true
So in Scratch we are looping until the count is bigger than 10, in GP we loop while the count less than 11
Scratch | GP |
---|---|
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 |
Fastest way to loop forever without waiting for screen refreshes
If and If/Else
Scratch GP
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 🙂
GP has a lot in common with Scratch but some notable differences
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
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
Other notable differences 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.