0 Members and 1 Guest are viewing this topic.
Also make a tutorial for hit detection. I've never fully understood how to do it without checking every object and compare locations (or is that fastest way?)
I was trying to implement your item removal routine with my "falling sand" style game game, and it crashes my calc!! HELP!
:.SAND:ClrDraw:ClrHome:Fix 1:Text(5,10,"Zen Sandbox"):Fix 0:Repeat getKey(9):End:ClrDrawr:0→L:0→W:10→F→G:0→{L1}:0→{L2}:Repeat getKey(15): If W>0: For(J,0,W): {2*J+L2}→B: {2*J+L2+1}→C: Pxl-On(B,C): End: End: For(K,0,L): {2*K+L1}→X: {2*K+L1+1}→Y: Pxl-Off(X,Y): If pxl-Test(X,Y+1): rand^2*2-1→A: !If pxl-Test(X+A,Y): X+A→X: Else!If pxl-Test(X-A,Y): X-A→X: End: Else: Y+1→Y: Lbl RE: End: If Y>63 and (L>1): conj(K*4+L1+2,-2,L-1→L-K*4+1): Pxl-Off(X,Y): Goto ER: End: If X<0: 95→X: End: If X>95: 0→X: End: X→{2*K+L1}: Y→{2*K+L1+1}: Pxl-On(X,Y): Lbl ER: End: Pxl-Off(F,G)r: If getKey(1): G+1→G: End: If getKey(2): F-1→F: End: If getKey(3): F+1→F: End: If getKey(4): G-1→G: End: If getKey(54) and (L<200): L+1→L: F→{L*2+L1}: G→{L*2+L1+1}: End: If getKey(55) and (W<200) and (not(pxl-Test(F,G))): W+1→W: F→{W*2+L2}: G→{W*2+L2+1}: End: Pxl-On(F,G)r: Fix 5: Text(0,0,L►Dec): Fix 4: DispGraphr: If getKey(56): For(B,0,L*2): 0→{L1+B}: End: 0→L: For(B,0,W*2): 0→{L2+B}: End: 0→W: ClrDraw: End:End:ClrDraw
hee hee. whoops. let me fix that... yeah that doesn't work. it sort of shifts the screen over a bit, and then crashes the calculator... instead of crashing right away.
hmm, reminds me of a tutorial I was writing to actually implement Java-styled OOP with Axe, with instances, classes, and a slight bit o' inheritance, along with attaching methods and such. If you want I can give it to you DT.