Pygame examples RISC OS

Last updated Saturday the 14th of August, 2021

post from ROOL forum... CJ)

A version of pygame 1.9.6 is available (Python-38-pygame). Most things seem to work, and you can play the "aliens" example game. You will need to run pygame things with stdout redirected.

...if you run the python script by double-clicking it runs Python via the !Run file which uses the TaskWindow command. This fails as pygame uses SDL which runs as a Wimp Task so cannot run from a task window.

The easiest way is to use an Obey file..

The ...pygames.examples directory contains a sub-directory ...pygame.examples.RISCOS which has an obey file for each example.

Test results for RISCOS.examples

 To see instructions from the programs
 change the obey file Python38 commands
 from    "> null:"  to   "> .stdout"

AACircle            good

Aliens              good
                    playable frantic

Blend_Fill          goodish
                    then R,G,or B black out images

Blit_Blends         good
                    tries to import numpy
                    but ok if not available

Cursors             needs fix to line 82 :-
                    bg = pygame.display.set_mode((800, 600), 0, 24)  #bug
                    bg = pygame.display.set_mode((800, 600), 0, 0)   #fix

                    no output

Chimp               good

EventList           good
                    useful status checker

FastEvents          not good
                    opens window nothing happens
                    click close icon after pause
                    aborts fatal signal
                    opens stack trace
                    Nothing in Reporter list
                    Leaves Python38 task in memory

                    on Mac
                    opens window closes window
                    prints some stats:
                    total time:1.3096

Fonty               not good
                    LOCKS SYSTEM - alt-break to exit
                    on mac opens window with text in 4 styles
                    and outputs font metrics for "Fonty"
                    and a kanji character
                    a click closes window
                    The japanese lines are commented out

Freetype_Misc       good
                    opens window with text
                    any mouse or key exits

Liquid              good
                    opens animated window
                    any mouse or key exits

MoveIt              good
                    opens animated window
                    any key exits

PixelArray          good
                    opens window
                    any mouse click changes display
                    after 12 clicks exits

Scroll              good
                    opens window with scroll ctrls
                    mouse on ctrls works

Sound               make a sound but not right

Stars               good
                    opens animated starfield window
                    click anywhere for new origin

TestSprite          good
                    opens animated window
                    lots of moving sprites

Notes on the other examples

Some examples are not included in the RISCOS folder. Here are some notes about these.


  error numpy missing
  *python3 -m pip install numpy
  ModuleNotFoundError: No module named 'pkg_resources'

  At the moment you can only install pure Python modules
  using pip on RISC OS. numpy contains several C modules
  which need to be built but the build environment doesn‘t exist.

  requires pygame 2 (risc os currently 1.9.6)
  needs SDL2        (risc os currently 1.2)

  bad call from camera.init     (no camera anyway)

  needs SDL2        (risc os currently 1.2)

  requires PyOpenGl

  runs but difficult to tell if anygood

  requires Windows

  no available video device

 ModuleNotfoundError - no module named 'pygame.scrap'

  needs numpy

  needs SDL2

  needs numpy

  requires pygame 2 (risc os currently 1.9.6)

© 2021 JR