Python Coding Competition! (competition ended)
First of all, a very big thank you to @Hanski and @FManga for their hard work on the incredible Python IDE and the tutorials and wikis. These will make Python coding on Pokitto much easier!
To celebrate this, the Batcomputer has decided to host a small competition to encourage people to try out Python coding on Pokitto and give to feedback and ideas about the tools.
RULES
( NOTE, âby 30thâ means you can send your entry ON 30th. Sorry for saying it unclearly.
It is NOT so serious. On sunday the 31st I intend to start feeding the entries into the Batcomputer. I need time to conver the Python into punchcards.)
-
make a Pokitto game / app using our Python editor pyinsky.herokuapp.com
-
and submit it in this thread by (and including)! 30.3.2019 or by sending to python@pokitto.com
-
entry must include
â .py source code
â game binary saved from our python editor
â license information for graphics or other resources that you have not made yourself
-
if you need help in getting up and running with the tools, come here to this thread to ask for help
-
the game must be âcompleteâ in the sense that it can be loaded on Pokitto, played and enjoyed
-
game code has to be open-source so other can benefit from your wisdom!
-
game can not use images / other copyrighted material that the author does not own
-
author gives permission for game to be put on next gamedisk compilation
-
winners shall be chosen by the almighty Batcomputer and @Hanski the boy wonder. We citizens of Gotham can trust them to be fair judges
-
this competition will also be announced on Twitter
-
I reserve the right to amend rules if the situation requires it! Nobody will be cheated but if something happens, I will simply deal with it.
-
warning: rude, offensive or impolite stuff will get deleted
PRIZES
Fully kitted Pokitto + Pokitto logo T-shirt for THREE best entries:
- best beginner
- best mid range
- best advanced coder
Everyone has a chance! The jury wonât just give prizes to old experienced coders. We will look at the submissions and we can see the effort of the individual submissions.
⌠and ofcourse the admiration of Pokitto community to prize winners and participants!
COMPETITION ENTRIES
COMPETITION IS OVER! Here are all 18 entries in one zip-packet (thanks @spinal). Unzip the bin files to your SD card or flash each file separately:Spring 2019 Contest.zip (2.0 MB)
Here are competition entries (in release order).
Entry: Mandelbrot set
Author: @drummyfish
Sources:
Here
# Drummyfish, CC0
import upygame as upg
import framebuf
upg.display.init()
screen_sf = upg.display.set_mode()
RESOLUTION = (40,25)
ITERATIONS = 100
PIXEL_SIZE = 3
SUBDIV = 1000
COLORS = 5
center = [-500,0]
view_width = 2500
step = view_width // RESOLUTION[0]
top_left = (center[0] - RESOLUTION[0] // 2 * step, center[1] - RESOLUTION[1] // 2 * step)
def mandelbrot(point):
z = [0,0] # complex number to iterate
color = 0
try:
for n in range(ITERATIONS):
# Mandelbrot formula: f_c(z) = z^2 + c
z = ((z[0] * z[0] - (z[1] * z[1])) // SUBDIV + point[0],
(2 * z[0] * z[1]) // SUBDIV + point[1])
abs1 = z[0] if z[0] >= 0 else -1 * z[0]
abs2 = z[1] if z[1] >= 0 else -1 * z[1]
length = abs1 if abs1 >= abs2 else abs2
if length > 1000000000 or length != length:
return 1
except Exception:
return 1
return 0
point = [top_left[0], top_left[1]]
fractal = []
for y in range(RESOLUTION[1]):
for x in range(RESOLUTION[0]):
fractal.append(mandelbrot(point))
point[0] += step
point[0] = top_left[0]
point[1] += step
while True:
eventtype = upg.event.poll()
i = 0
for y in range(RESOLUTION[1]):
for x in range(RESOLUTION[0]):
screen_sf.fill(fractal[i],upg.Rect(x * PIXEL_SIZE,y * PIXEL_SIZE,PIXEL_SIZE,PIXEL_SIZE))
i += 1
upg.display.flip()
Binary:
Screenshot or video:
Entry: Bounce!
Author: @wuuff
Sources:
Here
# Welcome to Python on Pokitto!
import upygame as pygame
import umachine as pok
pygame.display.init()
screen = pygame.display.set_mode() # full screen
screenRect = screen.get_rect()
screenW = screenRect.width
screenH = screenRect.height
ballPixels = b'\
\x01\x70\
\x17\xcf\
\x7c\xcf\
\x0f\xf0\
'
ball2Pixels = b'\
\x01\x60\
\x16\xae\
\x6a\xae\
\x0e\xe0\
'
ballSurface = pygame.surface.Surface(4,4,ballPixels)
ball2Surface = pygame.surface.Surface(4,4,ball2Pixels)
#pok.draw_text(0,10,"hello", 1)
pygame.display.flip()
balls = [{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5},\
{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5},{'x':0,'y':44,'vy':5}]
currBall = 0
ballTimer = 0
bounce = 'bounce!'
while True:
ballTimer += 2
if ballTimer == 10 and currBall < len(balls):
ballTimer = 0
currBall += 1
#pok.draw_text(myX,10,"hello", 1)
#screen.blit( ballSurface, myX, myY, 0 )
for b in range(0,currBall):
ball = balls[b]
if b < 7:
pok.draw_text(ball['x'],ball['y']-10,bounce[6-b], 1)
ball['x'] += 2
if ball['x'] > 110:
ball['x'] = 0
if ball['y'] < 44:
ball['vy'] += 1
else:
ball['vy'] -= 1
ball['y'] += ball['vy']
screen.blit( ballSurface, ball['x'], ball['y'], 0 )
screen.blit( ball2Surface, ball['y'], ball['x'], 0 )
pygame.display.flip()
Binary:
Screenshot or video:
Entry: Rexitto
Author: @HomineLudens
Source: Rexitto.zip (26.3 KB)
Binary: rexitto.bin (152.6 KB)
Screenshot or video:
Entry: You shall not pass
Author: @FManga
Source: pokitto-mpy-project(20).zip (153.3 KB)
Binary: build(48).bin (175.3 KB)
Instructions or other info
How to play:
Youâre a knight on an important quest⌠but a pesky lizard is in your way.
Left : Sword attack. Effective against attempts to heal.
Up : Heal yourself. Makes you vulnerable to sword attacks.
Right : Block. Reflects sword damage back to opponent.
Screenshot or video:
Entry: Dr Mriller
Author: @fmanga
Source: pokitto-mpy-project(49).zip (81.4 KB)
Binary: build(79).bin (155.8 KB)
Screenshot or video:
Entry: Noggin
Author: @spinal
Source: NogginSource.zip (151.0 KB)
Binary:Noggin.bin (188.8 KB)
Instructions and other info
Each tile gives you a number, make that many moves without crossing your path then hit A.
Wildcards are as follows,
Jack - swap a tile from the spares pile.
Queen - choose any tile horizontally or vertically, but all tiles in that line will flip.
King - Same as Queen, but only your selected tile will flip.
! - Move one tile, but reserve the ability to move anywhere by pressing B when on your starting tile.
A - Turn a tile
B - return to start tile
C - start fresh game
Screenshot or video:
Entry: KameraKatze
Author: @ServalKatze
Source: KameraKatze_sfx.zip (116.8 KB)
Binary: kamerakatze (4).bin (173.9 KB)
Instructions and other info
You are a kitty.
Take pictures of the sleeping lion to score points. Note how the environment changes as your score increases. Donât get noticed by the scary lion.
Entry: Pyrates
Author: @jonne
Source:pyrates.zip (237.5 KB)
Binary: pyrates.bin (210.3 KB)
Instructions and other info
Pyrates !!
ARRR, me mateys!
1. Objective of the game
For a pirate,
a fate far worse than the treacherous rocks ripping the ship to shreds, far worse than the raging seas, the howling winds, or the mystical sea-monster Kraken
⌠is running out of Grog
Sailing the dangerous waters of the Spanish Main, you as a captain have to take care of your ship and crew. Your goal is to sail to different islands, land on the ports and make sure your ship stays brimmed with Grog.
2. Buttons
-
Left, Right steer ship to Port (anticlockwise) or Starboard (clockwise)
-
C restart game
-
A (while sailing) fire cannon (needs time to reload)
-
A (while docked at port) boost yourself out of a harbour
-
Left, Right (while âLandedâ) jiggle ship to traverse through land
3. Basics of Sailing
- Watch the wind direction
- You canât go against the wind
- Sideways to wind is often faster than directly downwind
- âTackingâ i.e. going slightly against the wind allows you to climb upwind - if wind is strong enough
4. Gameplay hints
- if you get lost at sea, just press âCâ to restart the challenge
- PRESS A several times in the beginning to start
- if you are Landed you can jiggle your boat to get loose
- if you wish to exit a port, turn your ship and press A to give it a push
- the shipâs mast watch will call âLand Ahoyâ when he sights land. You can then try to sail in that direction. It is easy to miss the islands!
- not all islands are safe to land - the port may be in an impossible place. Sail away to another island
Now go learn the ropes, ya miserable landlubber!!
Interesting factoid: What is Grog?
license info
all gfx, code by me
sfx by me
âBonnie Lassâ trad. Irish song, Public Domain midi played through a FM synthesis soundfont
Entry: **Torâs Game Gallery **
Author: @torbuntu
Source:TorsGameGallery.zip (97.8 KB)
Binary:tgg.bin (173.3 KB)
Binary:
Instructions and other info
Mecha Narwhal
Explore the ocean depths as the Mecha Narwhal! Dodge shark poky coral, avoid or dash through dangerous jellyfish, and keep an eye out for those pesky sharks!
The farther you explore, the faster youâll go! Keep your eyes open.
Angry space toast
Just a simple avoidance game where youâre objective is to not get clobbered by the angry space toast. You have a shield, but it can only take so much buttery angst. Once that is depleted you have minimal health remaining before youâre toast
.
A
is the button to start the round. Movement is with D-pad but thrust is either UP or A. No other controls yet.
Entry: Big Blue
Author: @andrewb
Source: BigBlue.zip (32.2 KB)
Binary: file.bin (156.5 KB)
Instructions and other info
Your goal in it is to guide the astronaut home, avoiding aliens, comets and rockets across 5 different levels of increasing difficulty.
Entry: U.F.O.
Author: @sbmrgd
Source:ufo.zip (60.5 KB)
Binary:ufo.bin (159.8 KB)
Instructions and other info
You have to defend your planet against aliens by shooting ufos. There are three types of ufos: a big one , a medium one and a small one. In the left upper corner there is some kind of a compass that gives an idea where the current ufo is situated. You have 2 minutes to shoot as many ufos as possible:
Controls:
d-pad controls your ship
a-button fires the lasers
b-button goes to game over screen
c-button: starts game
Entry: ScummPy Quest I: The Jammed Door
Author: @jpfli
Source: scummpy.zip (76.3 KB)
Binary: scummpy.bin (178.3 KB)
Instructions and other info
Point-and-click puzzle.
Entry: 1q48
Author: @chame
Source:
1q48_v0_2.zip (9.9 KB)
Binary:1q48_v0_2.bin (161.8 KB)
Entry: Boblo
Author: @HomineLudens
Source: boblo.zip (84.4 KB)
Binary: boblo.bin (174.3 KB)
Instructions and other info
Boblo is a strange creature, itâs made of air and water but itâs not affected by gravity.
It bubbles trough the space and canât stop until it crash against a wall.
Help Boblo to collect as much coins as you can in this little puzzle game.
Itâs a dangerous world filled with secret passages and switches.
Thereâs always more then a way to reach the exit.
Enjoy!
More Boblo levels can easily added in âlevelData.pyâ:
Here an example and syntax for each tile. Iâd like to add more level in future.
lvl00 = (\
'.x.x.',\
'x..zx',\
'...x.',\
'x..ax',\
'.x.x.',\
)
Here a list of possibles tiles:
x = blue box
w = wall, state ON (solid)
W = wall, state OFF (invisible, not solid)
+ = blades state ON (they hurts!)
= = blades state OFF (not solid)
! = vertical moving blades
B = toogle button, state ON (activate/deactivate tiles)
b = toogle button, state OFF
K = Key, open final locked gate
o = coin
| = red box, vertical moving
- = red box, horizontal moving
< = left pushing tile
> = right pushing tile
^ = up pushing tile
v = down pushing tile
z = final tile state OPEN
Z = final tile state CLOSED (solid)
a = start tile
Entry: Jetpack
Author: @bl_ackrain
Source:jetpack_v1(1).zip (57.4 KB)
Binary: jetpack_v1_1.bin (165.6 KB)
Entry: The Villainy of Cat Food Inc
Author: @ServalKatze
Source:VoCFI.zip (25.8 KB)
Binary:vocfi.bin (154.2 KB)
Instructions and other info
The Story
Cat Food Inc. - the major supplier of cat food in town - has catnapped Nanji, Guyâs cat, and wants to use her to promote their latest brands of cat foods.
Help Guy to rescue Nanji from the evil clutches of Cat Food Inc.
How to play
This is a little puzzle game. The goal is to reach the exit.
Push crates out of the way.
Pick up keys and use them to open normal doors.
Push the pushbutton to open the pushbutton door.
Entry: Legend of Lanea
Author: @dir3kt
Source: https://github.com/jlauener/Legend-of-Lanea
Binary: lanea.bin (190.9 KB)
Instructions and other info
Legend of Lanea is a Zeldaesque adventure for the Pokitto.
Controls
- Directional stick: move
- A: interact/attack
- C: start game, pause
Entry: Top Fish
Author: @wuuff
Source:topfish.zip (11.5 KB)
Binary: topfish.bin (148.0 KB)
Instructions and other info
There are a lot of fish in this pond, and youâre the tiniest. Avoid the bigger fish and eat smaller or same-sized fish to get bigger, so you can become the Top Fish!