Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
loeasy68
GitHub Repository: loeasy68/loeasy68.github.io
Path: blob/main/code.p8.txt
2934 views
1
pico-8 cartridge // http://www.pico-8.com
2
version 41
3
__lua__
4
function _init()
5
positionx=63
6
positiony=63
7
isnotclear=0
8
end
9
10
function _update()
11
--player movement--
12
if btn(➡️) then
13
positionx+=1
14
end
15
if btn(⬅️) then
16
positionx-=1
17
end
18
if btn(⬆️) then
19
positiony-=1
20
end
21
if btn(⬇️) then
22
positiony+=1
23
end
24
25
end
26
27
28
29
function _draw()
30
--basic level system
31
cls()
32
spr(1, positionx,positiony)
33
if isnotclear == 0 then
34
spr(1,positionx,positiony)
35
spr(2,12,12)
36
print("x:")
37
print(positionx)
38
print("y:")
39
print(positiony)
40
--collisions(can only be in draw)
41
if positionx == 12 then
42
if positiony == 12 then
43
print("on it")
44
cls()
45
spr(1,positionx,positiony)
46
isnotclear=1
47
end
48
end
49
end
50
end
51
__gfx__
52
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
53
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
54
00700700000000000099000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55
00077000005500000aa9a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
56
0007700000ff000099aa900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
57
0070070009999000a9aa900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
58
00000000009900000999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
59
00000000009900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
60
61