#################################
# BASIC Tenliners Contest 2020  #
#                               #
# Curse of the Aztec Temple     #
# (c) 2020 Roman Werner @romwer #
# email: roman.werner@gmail.com #
#################################

1934, deep inside Mexico's ancient rainforest. Just as you have found the long lost entrance to the legendary Aztec temple, a heavy stone slab falls into its predetermined place behind you. The glittering sea of diamonds lets you forget for a moment that your way back is cut off forever. And the scattered hissing sound doesn't bode well, especially when you can barely see two steps ahead.

Features
=======
- Aztec themed level design 
- Lots of diamonds to collect
- Randomly hidden poisonous snakes
- Free antidote after each temple
- Every level gets harder

Task and Goal
============
Your goal is to collect all the diamonds in as little time as possible. But beware of the nasty poisonous snakes - 3 times bitten and the treasure hunt is over. Only when you have collected all diamonds, another mechanism is activated and opens the exit to freedom and - if you have been bitten - the way to the vital antidote.
With each new temple, the number of snakes increase, so pay attention with your further steps.

Control
======
Cursor keys (left/right/up/down -or- w/a/s/d in the "wasd" version)
Space to restart

Game Requirements
=================
- C64/C128* with BASIC 2.0 runtime environment (or compatible)
- 1 Player

*Also playable on Windows/MacOS/iOS/Android (C64 Emulator required)

Starting in VICE: C64 emulator (http://vice-emu.sourceforge.net/)
====================================================
Start the emulator and then drag and drop the "aztectemple.prg" into the VICE window.
-or-
Load the program with the command: load "aztectemple.prg",8
Then start the program with:       run

Download: http://www.kingroman.com/c64/CurseOfTheAztecTemple.zip


Curse of the Aztec Temple BASIC program code:
=============================================
0readl$:s$="{reverse off}{green} U{down}{left}{left}U{light green}K":t$(0)="{reverse on}{black}  {down}{left}{left}  ":t$(1)="{reverse on}{pink}{sh @}{yellow}{cm p}{down}{left}{left}{cm p}{pink}{sh @}":t$(2)="{white}{reverse on}{sh pound}{purple}{cm asterisk}{down}{left}{left}{reverse off}{cm asterisk}{dark gray}{sh pound}"
1f=53280:pokef,0:pokef+1,0:print"{clear}";:p=211:r=214:m=20:fori=1tolen(l$):c=asc(mid$(l$,i,1))-35
2t=int(c/m):n=c-t*m:forj=1ton:printt$(t)left$("{up}",pos(0));:d=d-(t=2):next:next:q=58640:x=18
3m$="{reverse on}{orange}{cm v}{brown}{cm c}{down}{left}{left}{pink}L{red}{sh @}{left}{left}{up}":print"{reverse off}{white}temple"tab(32)"diamons{left}{148}d";:y=x:s=160:v=0:l=l+1:poke198,0
4o=1024+y*40+x:e=e-(peek(o)=233):pokep,16:ifpeek(o)=32thenpokef,2:fori=0to99:next:pokef,0:v=v+1
5poker,24:sysq:print"{reverse off}{white}"l":"etab(26)"{red}";:ifv=3thenprint"{right}{right}{red}Q{home}"tab(14)"{white}{reverse off} game over ":wait197,8:run
6printleft$("QQ",v);:pokep,x:poker,y:sysq:printm$;:ife=dthenprint"{reverse on}{light blue}OP{down}{left}{left}  ":fori=0tor:pokef,iand7:next:goto1
7geta$:a=(a$="{left}")-(a$="{right}"):b=(a$="{up}")-(a$="{down}"):z=a*2+b*80:ifz=0orpeek(o+z)=250goto7
8printt$(0):x=x+a*2:y=y+b*2:on-(rnd(0)>l/morpeek(o+z*3)<>s)goto4:pokep,x+a*4:poker,y+b*4:sysq
9prints$:goto4:dataj959%8m8%m%8m8%9l$8m8%9%8m8$l9l$;%9%;$l9l3l9&;o;&9&8u8&9&c&959q$;$qj9


Curse of the Aztec Temple BASIC program code (PUR-80 version using command abbreviations):
==========================================================================================
0rEl$:s$="{reverse off}{green} U{down}{left}{left}U{light green}K":t$(0)="{reverse on}{black}  {down}{left}{left}  ":t$(1)="{reverse on}{pink}{sh @}{yellow}{cm p}{down}{left}{left}{cm p}{pink}{sh @}":t$(2)="{white}{reverse on}{sh pound}{purple}{cm asterisk}{down}{left}{left}{reverse off}{cm asterisk}{dark gray}{sh pound}"
1f=53280:pOf,0:pOf+1,0:?"{clear}";:p=211:r=214:m=20:fOi=1tolen(l$):c=aS(mI(l$,i,1))-35
2t=int(c/m):n=c-t*m:fOj=1ton:?t$(t)leF("{up}",pos(0));:d=d-(t=2):nE:nE:q=58640:x=18
3m$="{reverse on}{orange}{cm v}{brown}{cm c}{down}{left}{left}{pink}L{red}{sh @}{left}{left}{up}":?"{reverse off}{white}temple"tA32)"diamons{left}{148}d";:y=x:s=160:v=0:l=l+1:pO198,0
4o=1024+y*40+x:e=e-(pE(o)=233):pOp,16:ifpE(o)=32tHpOf,2:fOi=0to99:nE:pOf,0:v=v+1
5pOr,24:sYq:?"{reverse off}{white}"l":"etA26)"{red}";:ifv=3tH?"{right}{right}{red}Q{home}"tA14)"{white}{reverse off} game over ":wA197,8:rU
6?leF("QQ",v);:pOp,x:pOr,y:sYq:?m$;:ife=dtH?"{reverse on}{light blue}OP{down}{left}{left}  ":fOi=0tor:pOf,iaN7:nE:gO1
7gEa$:a=(a$="{left}")-(a$="{right}"):b=(a$="{up}")-(a$="{down}"):z=a*2+b*80:ifz=0orpE(o+z)=250gO7
8?t$(0):x=x+a*2:y=y+b*2:on-(rN(0)>l/morpE(o+z*3)<>s)gO4:pOp,x+a*4:pOr,y+b*4:sYq
9?s$:gO4:dAj959%8m8%m%8m8%9l$8m8%9%8m8$l9l$;%9%;$l9l3l9&;o;&9&8u8&9&c&959q$;$qj9

Tip: Copy/paste the program-Code into CBM prg Studio (http://www.ajordison.co.uk/).
There you can see the commands in nice color highlighting and you can directly execute the game in an emulator of your choice.


Trivia
======
In May 2019 the forum64.de member "BIF" called for a practice exercise to create a tenliner with predefined level data based on 2x2 tiles. As an example he showed a screenshot of his own tenliner "Schatzhöhle" (treasure cave) to show what this could look like (see https://www.forum64.de/index.php?thread/89410-z10-mini-schatz-h%C3%B6hle). I first thought that making a game with level data and exhausting graphic tiles would be too much for a PUR-80 type (my favorite category) but was glad that BIF proved that it's feasible. Also his trick to use the command pos(0) for something useful was a nice revelation. Therefore big credits for this tenliner go to BIF. It's always easier to go for something when you know that it is generally possible. So, thank you BIF!

