Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Batprime11

Pages: [1]
1
Axe / Game optimizations?
« on: July 31, 2022, 06:22:29 pm »
I have been working on a Chrome dino clone (chrome://dino) for a while now. Now I have optimized to the best of my capabilities  :banghead:, and am wondering if there are any optimizations that I am missing. I will take anything, even if it is one byte smaller. I am optimizing for size mostly, but any speed optimizations would also be welcome.

Code: [Select]
.DINO
#Icon(007E00FF00DF00FF00F000FE81F883F8C7FEFFFAFFF83FF00FE0066004400660)
41→Q→Z
Pic1DINO1→N
.ANIM 1
Goto MENU
prgmTILESPRT
Lbl TXXT
Text(20→B*256+3
Text r₁
Text(6659
Text r₂
Text(8195
Text r₃
Return
Lbl PAUSE
For(35565)
End
Return
[0000000000004143→Pic1DINO1
[7EFFDFFFFFF0FCE0
[677F7F3F1F0C080C
[E0F8E8C080C00000
.ANIM 2
[0000000000004143→Pic1DINO2
[7EFFDFFFFFF0FCE0
[677F7F3F1F080C00
[E0F8E8C0C0C080C0
.CACTUS
[001858D8D8DADBDB→Pic1CACT1
[DB7E3C1818181818
Lbl OPTN
ClrDraw
PAUSE()
TXXT("Min Dist","Min Offset","Back"
Text(40*256)
Text "Ducking coming soon!
IRect(3,20,32,6
Text(20*256+33
Text Z►Dec
Text(26*256+35
Text Q►Dec
DispGraph
While 1
If B=26 and getKey(2)
Text(26*256+35
Text max(Q-1,1)→Q►Dec
PAUSE()
End
If B=26 and getKey(3)
Text(26*256+35
Text min(Q+1,65534)→Q►Dec
PAUSE()
End
If B=20 and getKey(2)
Text(20*256+33
Text max(Z-1,1)→Z►Dec

PAUSE()
End
If B=20 and getKey(3)
Text(20*256+33
Text min(Z+1,65534)→Z►Dec
PAUSE()
End
If getKey(15) or (B=32 and getKey(54))
Pause 400
Goto MENU
End
If getKey(4)
3
Asm(E5
IRect(,B,30,6
Asm(E1
IRect(,max(B-6,20)→B,30,6
PAUSE()
End
If getKey(1)
3
Asm(E5
IRect(,B,30,6
Asm(E1
IRect(,min(B+6,32)→B,30,6
PAUSE()
End
DispGraph
End
Lbl MENU
ClrDraw
Fix 5
RectI(0,16,*2+1,26
RectI(1→D,17,31,24
TXXT("PLAY!","OPTIONS","QUIT")
IRect(3,20,27,7
While 1
If getKey(4)
3
Asm(E5
IRect(,B,27,7
Asm(E1
IRect(,max(B-6,20)→B,27,7
D++
PAUSE()
End
If getKey(1)
3
Asm(E5
IRect(,B,27,7
Asm(E1
IRect(,min(B+6,32)→B,27,7
D--
PAUSE()
End
DispGraph
If getKey(15)
Fix 4
Return
End
EndIf getKey(54)
!If B-32
Fix 4
Return
End
!If B-26
Goto OPTN
End
Lbl MLOOP
ClrDraw
196→I
47*256→C→B→A
15→F→D→J-2→E→H
#ExprOn
While 1
RectI(0,63,95,1
RectI(31,23,65,1
RectI(31,0,+1,22
!If H--
Rect(90,0,+2,23
rand^Q+Z→H
End
If I++ and {22*12+L₆+3}ʳ[e]7
TS(,+1,88,47,Pic1CACT1
⁻3→I
End
Lbl JUMP
If C-47 or (D<<0)
D+E→D+B→B
End
If C>47
-1→D
12→E
12032→B
Else!If C-47
12→E
End
If C≥47 and getKey(4)
⁻350→D
End
If getKey(1)
50→E
End
DS<(F,20)
If Pic1DINO1=N
Pic1DINO2→N
Else
Pic1DINO1→N
End
End
2
Asm(E5
TS(,,-2,C,N)
DispGraph
Asm(E1
TS(,,-2,C,N)
RectI(0,63,95,1)
RectI(31,23,65,1)
WRect(31,0,+1,21)
Horizontal-
B/256→C
EndIf pxl-Test(15,C+4) or pxl-Test(8,*2+C) or pxl-Test(4,C+16) or getKey(15)
Goto MENU

Pages: [1]