This commit is contained in:
2026-02-04 19:40:23 +01:00
parent 3f5cf6a1f0
commit 668d18b584
3 changed files with 218 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# Spielbescheibung Jump n Jump
## Grobe Idee:
In diesem Spiel steuere ich einen Ball, der über eine Bahn geführt werden will, die von rechts nach links scrollt. der Ball hüpft dabei immer mit einer kleinen initialen Kraft und verbraucht somit minimal Energie.
Um Hindernisse zu überwinden muss der Ball mehr Energie aufwenden. Dieses kann ich als Spieler einstellen indem ich die Pfeiltaste nach unten drücke. Je länger ich drücke, um so mehr Kraft habe ich (und verbrauche ich dann auch).
Auf der Strecke kann ich zusätzlich Energie einsammeln. Ich muss immer auf der Plattform bleiben. Falle ich aus dem Bild, ist das Spiel auch zuende. Erreiche ich bestimmte Punkte, so kann ich an diesen Stellen "respawnen". Treffe ich auf was Spitzes, platzt der Ball.

106
cards/scrolltest.p8 Normal file
View File

@@ -0,0 +1,106 @@
pico-8 cartridge // http://www.pico-8.com
version 43
__lua__
-- game main loop
game_state={
state = 1 -- 1: title 2: game 3: over
}
function _init()
bx = 0
by = 0
map_x=0
map_y=0
finex=0
finey=0
end
function _update()
-- update scrolling
finex -=1
if finex<-8 then
finex=0
bx +=1
end
map_x=map_x+finex
-- update game_objects
for object in all(game_objects) do
object:update()
end
end
function _draw()
cls(12)
-- draw background
map(bx,by,finex,map_y,17,10)
map(0,16,0,80,16,6)
-- draw game_objects
for object in all(game_objects) do
object:draw()
end
end
-->8
-- game objects
game_objects={}
--[[ template:
function make_object(_x,_y)
local object={
x=_x,
y=_y
}
function object:update()
end
function object:draw()
spr(1,x,y)
end
add(game_objects, object)
return object
end
--]]
__gfx__
00000000bbbbbbbb4444444499999999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000333b33334a44444a9aaaaaa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
007007003b3333b344444a449aaaaaa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0007700044444444444444449aaaaaa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00077000444a444444a444449aaaaaa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00700700444444a44444a4449aaaaaa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000004a44a444444444a49aaaaaa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000004444444444a4444499999999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__map__
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010101010101010101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000010100000000000000000000000000000000000000000000000101010101010101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010101010000
0000000000000000020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000001010101010101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000101010101000000010000
0000000000000000000000000000000000000000000000000000010101010100000000000000000000010101010000000000000000000000000000000000000000000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010101010100000000000000010000
0000000000010100000000000000010101010100000000000000000000000000000000000000000000000000000000000001010100000000000000000000000000000000000000000000000000000000000101010101010000000000000000000000000000000000000000000000000000000000000000000000000000010000
0000000000020200000000000000020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000000010000
0101010101020201010101010101020202020201010101010100000000000001010101000000000000000001010101010100000000000000000000000000000000000000000000000001010101010100000000000000000000000000000000000000000000000000000101010101000000000000000000000000000000010000
0202020202020202020202020202020202020200000202020200000000000002020202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010101
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100010101010101010101010100000000000000000000000000000000000000000000000001
0000000000000000000000000000000000000000000000000000000000000000000000000000010101010101010101010101010101010101010101010000000000000000000000000000000000000000000001010101010101010000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000010101010101000000000000000000000001010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000010101010101000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000010101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

101
cards/testgame1.p8 Normal file
View File

@@ -0,0 +1,101 @@
pico-8 cartridge // http://www.pico-8.com
version 43
__lua__
-- game main loop
game_state={
state = 1 -- 1: title 2: game 3: over
}
function _init()
make_player(60,60,1)
end
function _update()
-- update game_objects
for object in all(game_objects) do
object:update()
end
end
function _draw()
cls()
-- draw game_objects
for object in all(game_objects) do
object:draw()
end
end
-->8
-- game objects
game_objects={}
object_type={
player=1,
plattform=2,
ruby=3
}
-- player class:
function make_player(_x,_y,_sprite)
local object={
x=_x,
y=_y,
sprite=_sprite,
obj_type=object_type.player
}
function object:update()
if btn(⬆️) then self.y -=1 end
if btn(⬇️) then self.y +=1 end
if btn(⬅️) then self.x -=1 end
if btn(➡️) then self.x +=1 end
if self.y>120 then self.y=120 end
if self.y<0 then self.y=0 end
if self.x>120 then self.x=120 end
if self.x<0 then self.x=0 end
end
function object:draw()
spr(self.sprite,self.x,self.y)
end
add(game_objects, object)
return object
end
--[[ template:
function make_object(_x,_y)
local object={
x=_x,
y=_y
}
function object:update()
end
function object:draw()
spr(1,x,y)
end
add(game_objects, object)
return object
end
--]]
__gfx__
000000000077aa000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000077aaaa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0070070077a0a0aa0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000770007aaaaaaa0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00077000aaa0aa0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00700700aaa9009a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000aa999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000aa99000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000