Hello there!
As I mentionned to Lirtosiast earlier, It's sometimes possible to write uncommon routines in TI-Basic.
By the way, here is a mini-demo of a sidescrolling game I totally wrote in TI-Basic.
(see original post : https://tiplanet.org/forum/viewtopic.php?f=11&t=17866 )
Actually the screen does not shift : using line( commands to draw/erase make the illusion Smile
The aim is just to move this kind of "ufo" and avoid the mountains & valleys.
For now, the game 's during a few minutes and lives are infinites.
In order to have a more sensitive keyboard, I found a way :
when you run the game, you let the key [del] always pressed.
Then you just press another key to move up "a la flappy bird".
This program is 6mhz compatible (of course, you'll have better results on 15mhz calculators)

I propose to explain the trick required to sidescroll in Basic:
Imagine you draw a diagonal line like a slash /
Then , just on its left, you draw another one ,one more ...
Meanwhile, on the opposite-right side you erase with an anti-slash \, and you keep on erasing , going to the left too.
The result will be a mountain moving to the left!
/ \



Here are the sources ( http://www.cemetech.net/programs/index.php?mode=file&path=/83plus/basic/games/scrollingmountainsV5.zip )

SCROLLV5 (main program) :

Code:
CoordOff
GridOff
AxesOff
LabelOff
ExprOff
0➜Xmin:0➜Ymin
.5➜ΔX:.5➜ΔY
ClrDraw
Text(0,5,"* SCROLLIN'  MOUNTAINS *
48➜A:Ans➜E:Ans➜I:Ans➜M
DelVar BDelVar FDelVar JDelVar N
2randInt(1,7➜Y
48+Y➜C:Ans➜G:Ans➜K:Ans➜O
Ans➜L2(1
Y➜L3(1
Ans➜D:Ans➜H:Ans➜L:Ans➜P
1➜Q:1➜R:1➜S:1➜T
100➜dim(L2
Ans➜dim(L3
For(U,2,Ans
   Repeat V and -V<Y and Y+V<23
      2randInt(-7,7➜V
   End
   32+16U+abs(V➜L2(U
   Y+V➜L3(U
   Ans➜Y
End
1➜W
1➜θ
28➜Y
Repeat W>96
   prgmSOUSPROG
   θ+47➜A:P➜B
   L2(W➜C:L3(W➜D
   B<D➜Q
   prgmSOUSPROG
   θ+47➜E:D➜F
   L2(W➜G:L3(W➜H
   F<H➜R
   prgmSOUSPROG
   θ+47➜I:H➜J
   L2(W➜K:L3(W➜L
   J<L➜S
   prgmSOUSPROG
   θ+47➜M:L➜N
   L2(W➜O:L3(W➜P
   N<P➜T
End


SOUSPROG :

Code:
Y
For(θ,θ,θ+15
   Line(A-θ,B,C-θ,D,Q
   Line(E-θ,F,G-θ,H,R
   Line(I-θ,J,K-θ,L,S
   Line(M-θ,N,O-θ,P,T
   If pxl-Test(64-2Ans,48:prgmSPRG2
   Pt-Off(24,Ans,2
   Ans-1+2not(getKey
   Pt-On(24,Ans,2
End
Ans➜Y
W+1➜W


and finally, SPRG2 (explosion) :

Code:
Pt-Off(24,Ans,2
Line(A-θ,B-1,C-θ,D-1
Line(E-θ,F-1,G-θ,H-1
Line(I-θ,J-1,K-θ,L-1
Line(M-θ,N-1,O-θ,P-1
Pt-On(24.5,Ans-1.5+not(fPart(.5Ans
StorePic 0
For(U,0,9
   Pt-On(24.5-rand,Ans+.5-rand,randInt(2,3
   Pt-Off(24.5-rand,Ans+.5-rand,randInt(2,3
End
ClrDraw:RecallPic 0
Pt-On(23.5,Ans-1.5+not(fPart(.5Ans
θ-1➜θ:28
This expands what's possible in TI-BASIC. I'm surprised that 16 Line() per frame is so fast! Perhaps it would also be possible to add gravity with acceleration while still having a reasonable speed.

I may use the key repeating trick in my own demo.
Nice job! It's great to see people still pushing the limits of performance in monochrome BASIC.
lirtosiast wrote:
This expands what's possible in TI-BASIC. I'm surprised that 16 Line() per frame is so fast! Perhaps it would also be possible to add gravity with acceleration while still having a reasonable speed.
I may use the key repeating trick in my own demo.


@Lirtosiast & Ivoah, thank you Smile

Actually there are just 4 Line( per frame
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement