Jump to content
IGNORED

PLANES - A TI Logo Sprite Demo


pixelpedant

Recommended Posts

I've been working on a TI Logo video recently. 

 

By which I mean I haven't been working on a TI Logo video - I've been playing with TI Logo instead. 

 

This being the case, here is a TI Logo demo which is one thing I've thrown together, to show off how extremely capable TI Logo II is, as a platform for developing sprite graphics based games and demos. 

 

 

A_PLANES

 

It runs about 2.5 minutes.  In particular, the main purpose is to show how Logo's sprite commands accepting lists as arguments allow for all sprite commands to selectively target subsets or groups of sprites.  And, as well, to show that the relevant sprite subroutines are efficient enough to control (change path/speed/colour/pattern) for as many as all 32 sprites without resulting in any serious issues. It's not perfect, especially when commands are targeting all 32.  Sprite automotion is still what it is.  But Logo really holds up its end of the bargain. 

 

To run, per normal Logo operating procedure:

 

1) Place A_PLANES in DSK1

2) Start up TI Logo II

3) Type RECALL and press Enter.

4) Select Option 3 (All)

5) Select Option 2 (Disk)

6) Type "PLANES" as filename and press Enter.

7) Type "START" and press Enter.

 

But here is a recording, if you'd prefer that:

 

  • Like 9
Link to comment
Share on other sites

LOGO is the only available TI programming language I have not played with as of yet and now I feel compelled to pull that package off my shelf and study it closely. Curious about its limitations and how come there is practically nothing being developed using it. Like I need more distraction... 

Looking forward to your video!

  • Like 1
Link to comment
Share on other sites

For the curious.  Looks good. 

I like the FREEZE and THAW names for sprites. Might have to "borrow" those. :)

 

Spoiler

PROCEDURES.
----------.
.
TO DRAW .
CB 1 .
CS .
COLORSET .
TYPE "````````````````````abbbhipbbb````````````````````ebbbyzstrb``````````````
`````cdbbhibbbpb .
TYPE "``````````````````cb.bbyzhibpb``````````````````xb.bbbbyzbqr``````````````
````}bdbbbvttt.p .
TYPE "``````````````````.{.bhiphibbs``````````````````.~.byzpyzhib``````````````
`````.|bbbstryzb .
TYPE "````````````````````.|bbbb..bb`````````````````````.|bbhiurb``````````````
````````.bbyzbpb .
TYPE "``````````````````````cbhivtwb`````````````````````cbbyzpbpb``````````````
``````cbvttt.bpb .
TYPE "```````````````````cbdpbbhibpb```````````````````|b...byzbpb``````````````
`````.|.b..bhist .
TYPE "````````````````````.|bb..yzbb`````````````````````.|bburbbb``````````````
````````.|bbpbhi .
TYPE "```````````````````````.|bpbyz````````````````````````.bpbvt``````````````
``````````cbpbp .
END.
.
TO MSPRITES .
TELL :ALL SV 0 0 .
SMALL .
MAKE "ODDS [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 ] .
MAKE "EVENS [0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 ] .
TELL :ODDS .
SC 1 CARRY 1 ; GREY BITS .
TELL :EVENS .
SC 6 CARRY 0 ; PLANE .
TELL [0 1 ] SXY -80 96 .
TELL [2 3 ] SXY -54 96 .
TELL [4 5 ] SXY -90 69 .
TELL [6 7 ] SXY -44 69 .
TELL [8 9 ] SXY -100 42 .
TELL [10 11 ] SXY -34 42 .
TELL [12 13 ] SXY -90 15 .
TELL [14 15 ] SXY -44 15 .
TELL [16 17 ] SXY -80 -13 .
TELL [18 19 ] SXY -54 -13 .
TELL [20 21 ] SXY -90 -41 .
TELL [22 23 ] SXY -44 -41 .
TELL [24 25 ] SXY -100 -69 .
TELL [26 27 ] SXY -34 -69 .
TELL [28 29 ] SXY -110 -95 .
TELL [30 31 ] SXY -24 -95 .
FREEZE .
TELL :ALL SV 0 8 .
THAW .
END.
.
TO START .
DRAW .
MSPRITES .
WAIT 200 .
TELL :ALL .
; increasing their speed all at once, then decreasing .
REPEAT 5 [SS 8 WAIT 50 SS 16 WAIT 50 ] .
WAIT 250 .
; change half their colours .
TELL [0 2 8 10 16 18 24 26 ] .
REPEAT 8 [SC 2 WAIT 15 SC 6 WAIT 15 SC 7 WAIT 15 SC 13 WAIT 15 SC 10 WAIT 15 ] .
TELL [1 3 9 11 13 15 21 23 29 31 ] .
REPEAT 8 [SC 2 WAIT 15 SC 6 WAIT 15 SC 7 WAIT 15 SC 13 WAIT 15 SC 1 WAIT 15 ] .
WAIT 250 .
TELL :ALL .
; moving the entire formation back and forth ending up a little to the right .
REPEAT 4 [SXV 16 WAIT 25 SXV 0 WAIT 25 SXV -16 WAIT 17 SXV 0 WAIT 25 ] .
WAIT 250 .
; moving one side each in turn .
TELL [0 1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 ] SXV -8 WAIT 50 SXV 0 .
TELL [2 3 6 7 10 11 14 15 18 19 22 23 26 27 30 31 ] SXV 8 WAIT 50 SXV 0 .
WAIT 250 .
; moving every other line .
TELL [0 1 2 3 8 9 10 11 16 17 18 19 24 25 26 27 ] SXV -8 WAIT 35 SXV 0 WAIT 35 S
XV 8 WAIT 35 SXV 0 .
TELL [0 1 2 3 8 9 10 11 16 17 18 19 24 25 26 27 ] SXV 8 WAIT 35 SXV 0 WAIT 35 SX
V -8 WAIT 35 SXV 0 .
; moving closer together .
TELL [0 1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 ] REPEAT 5 [SXV 8 WAIT 10 SXV 0 
WAIT 15 ] .
TELL [2 3 6 7 10 11 14 15 18 19 22 23 26 27 30 31 ] REPEAT 5 [SXV -8 WAIT 10 SXV
 0 WAIT 12 ] .
WAIT 200 .
TELL :ALL SC 0 SS 0 .
FREEZE .
TELL 0 SS 0 CARRY 3 SC 1 SXY -45 -95 .
TELL 1 SS 0 CARRY 4 SC 6 SXY -45 -95 .
WAIT 50 .
TELL [0 1 ] SYV 32 .
WAIT 100 .
; freeze and thaw .
REPEAT 20 [FREEZE SY YCOR WAIT 15 THAW WAIT 15 FREEZE SY YCOR WAIT 15 THAW ] .
WAIT 50 .
REPEAT 8 [SV -32 32 WAIT 20 SV 0 32 WAIT 20 SV 32 32 WAIT 20 SV 0 32 WAIT 20 ] .
WAIT 100 .
REPEAT 16 [SMALL WAIT 20 BIG WAIT 50 ] .
WAIT 300 .
REPEAT 6 [REPEAT 2 [SV -32 32 WAIT 18 SV 0 32 WAIT 18 ] REPEAT 2 [SV 32 32 WAIT 
18 SV 0 32 WAIT 18 ] ] .
SV 0 32 .
WAIT 300 .
TELL :ALL SC 0 CB 7 CS .
END.
.
TO COLORSET .
MAKE "COLORS [0 1 0 9 13 5 10 2 13 11 6 13 12 10 13 13 16 13 14 5 10 15 6 13 ] .
START: MAKE "TS FIRST :COLORS + 3 .
MAKE "TS :TS .
MAKE "COLORS BF :COLORS .
MAKE "FG FIRST :COLORS - 1 .
MAKE "FG FPUT :FG [ ] .
MAKE "COLORS BF :COLORS .
MAKE "BG FIRST :COLORS - 1 .
MAKE "BG FPUT :BG [ ] .
MAKE "COLORS BF :COLORS .
TELL TILE :TS * 8 .
SC SENTENCE :FG :BG .
IF :TS < 18 GO "START .
END.
.
TO ABOUT .
CS .
PRINT [PLANES - A TI LOGO SPRITE DEMO ] .
PRINT [ ] .
PRINT [BY PIXELPEDANT ] .
PRINT [2022 ] .
PRINT [ ] .
PRINT [TO RUN, TYPE 'START' ] .
PRINT [ ] .
END.
** DONE **

 

 

Link to comment
Share on other sites

44 minutes ago, TheBF said:

How does one "list" the source code?

 

edit:

I know I know. RTFM BF.

:)

 

Printout 

 

Also, within Logo, you can list all procedures with "PP", which is commonly necessary when opening a new program, since there's no such thing as an "autorun" so you need to know what procedure to run, barring outside instructions. 

 

And you can inspect any procedure in the editor with EDIT PROCEDURENAME.

 

And incidentally, Logo doesn't tokenise or encode saved procedures at all, so you can even just open any saved file in a text editor and all the procedures will be sitting there one after another in the plain, at the end of the file.

 

  • Like 2
Link to comment
Share on other sites

More fun facts about TI Logo II: 

 

- Procedures can call themselves.

- Procedures can use the DEFINE command to create new procedures from lists.

- Procedures can use the TEXT command to output the content of a procedure to a list for modification.

- Procedures can RUN a list of commands contained in a variable (such as those acquired from a procedure with the TEXT command) with the RUN command.

- Procedures can ERASE procedures with the ERASE command.

 

Opportunities for self-modifying code insanity abound! ?

 

In particular, there would be very interesting opportunities for an exercise in Obfuscated Programming. 

 

Given there are no limits at all on a program entirely transforming itself into something completely different. 

 

Another factor contributing to the opportunity for obfuscated programming is just the fact that TI Logo does not have really any compulsory syntactic sugar at all.  Everything is just delimited with spaces.

 

  • Thanks 1
Link to comment
Share on other sites

On 4/3/2022 at 7:18 PM, Ksarul said:

There are seven or eight disks in the old Amnion library chock full of Logo programs, including a few programs that go into the recursive, self-modifying madness that is possible in the language.

Where can one find such disks?

I love LOGO

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...