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
                    events/second:152714

Fonty               not good
                    LOCKS SYSTEM - alt-break to exit
                    INVESTIGATE
                    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.

RESULTS

arraydemo
  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.

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

camera
  bad call from camera.init     (no camera anyway)

dropevent
  needs SDL2        (risc os currently 1.2)

glcube
  requires PyOpenGl

headless_no_windows_needed
  runs but difficult to tell if anygood

prevent_display_stretching
  requires Windows

scaletest
  no available video device

scrap_clipboard
 ModuleNotfoundError - no module named 'pygame.scrap'

sound_array_demos
  needs numpy

textinput
  needs SDL2

vgrade
  needs numpy

video
  requires pygame 2 (risc os currently 1.9.6)

© 2021 JR