User Tools

Site Tools


starting:examples:ponggp

This is an old revision of the document!


Table of Contents

PongGP

This is a copy of the original Scratch Pong game, re-written in GP to show some of the differences and simularities between Scratch code and GP code

There are 3 main differences between the two sets of code

  1. The stage has been replaced by a single instance consisting of a red line
  2. The costumes for the ball,padd and redline are drawn by GP itself
  3. The forever loops have been replaced by while loops with waits at the end of the loops
  4. The bouncing off the paddle code has been changed to reflect the difference in directions between Scratch and GP

redline

This script sets the image size and then fills it with red and moves it to bottom of screen

paddle

Creates the paddle image and moves it near bottom of screen


Make the paddle track the mouseX position in the equivalent of a forever loop

starting/examples/ponggp.1506936422.txt.gz · Last modified: 2017/10/02 05:27 by simplesi