Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Eeems on December 07, 2009, 07:26:54 pm
-
Well I have been able to code a game in class slowely...it's pure basic. It's a fall down clone, kind of.
After thirty loops of the movement code the screen shifts down, and the next time it shifts is 29 loops, then 28 and so on...you are a * and the solid tiles are O. You can jump move to the right or left, and you will fall if nothing is underneath you, unless you are at the bottom of the screen. I'll post the code in a bit, and hopefully someone can make a screenshot for me :)
Edit: ok here is the code, just over 400 bytes
» is the sto symbol
Ø is Theta
=/= is the does not equal signClrHome
Disp "BUILD?
Input "Y=1:N=0 ",A
If Not(A
Then
Input "ROWS: ",L
"O»Str1
ClrHome
For(A,1,16L)
Output(1,1,int(((A+1)/(16L))100
Str1+Sub(" O ",randInt(1,3),1»Str1
End
End
1ȯ
4»X
4»Y
30»R
Int(Length(Str1)/16)-6»L
Repeat Ø=L or Not(Y
Output(1,1,Sub(Str1,16Ø-15,128
Delvar M
Repeat M=R or K=34
getKey»K
Output(Y,X,"
If Ø=/=L
Then
16(Ø+Y-1)-16+X»Z
J-(J=/=0)+2(K=25 and not(J) and "O"=sub(Str1,Z+16,1»J
Output(1,15,R-M
Y+(not(J) and Y=/=8 and "O"=/=sub(Str1,Z+16,1))-(J and Y=/=1 and "O"=/=sub(Str1,Z-16,1»Y
End
16(Ø+(K=26 and "O"=/=sub(Str1,Z+1,1) and X=/=16)-(K=24 and X=/=1 and "O"=/=sub(Str1,Z-1,1»X
Output(Y,X,"*
Rand10
M+1»M
End
Y-1»Y
R-(R=/=1»R
Ø-(Ø=/=L»Ø
End
ClrHome
If not(Y
Then
output(1,3,"YOU LOSE
Else
Output(1,3,"YOU WIN
End
-
hmm i gladely make a screenie later if i get the time so ill post it then :)
-
Ok thanks!
-
Yay falldown! Can't wait for screenie :)
-
Lol, well it runs pretty quick, with no glitches, there is one optimization I noticed for speed and size, but it's small enough and I had to slow it down some with a rand10 statement so you could see your character...
I haven't actually beaten it on 30 rows yet.
Hey builderboy, do you want to try your luck at making a better level building routine? Or just make some cool levels?
-
Looks cool! I'll have to try this tomorrow...
:)
-
Nice ^^
Does it means you got your calc back or did you just use a school calc?
I'll give it a try later
-
I used the 83+ that I'm aloud to use at school but I have to give it back after school, so no, don't have my calc back yet....
-
I tried to program this, got confused, saw I copied a piece 2 times, got mad and stopped q:
To me it was rather fail then fall xD Didn't have any time afterwards (i hate exams)
-
What was the problem exactly? It works fine for me, and I have updated code that works a bit more smoothly, but I have to type it up.
-
I wasn't really focused and it appeared i scrammbled parts of it and even coded 3 lines 2 times xD
-
Ah ok lol
hopefully I'll have the time to type up the new code today
-
How do you get it off your school calc to type it at home?
-
I wrote it down
-
Better not let rust your TI-BASIC skillz.
-
lol, yeah :P
ok here is the most recent codeClrHome
"0000
Ans+Ans+Ans+Ans->Str1
For(B,8,1,-1)
Output(B,10,"*
rand10
Output(B,1,Str1
End
For(A,0,2)
Output(4+A,6,"_six spaces_
End
Output(5,6," FALL "
getKey
Repeat getKey
randInt(1,3,5
Output(8,2,"<PRESS A KEY>
randInt(1,3,5
Output(8,2,Str1
End
ClrHome
Repeat not(I
Disp "0=QUIT","1=RAND","2=LVLS
Input ":",I
IF I=1
Then
Input "TYPE: ",A
Input "ROWS: ",L
If A=1
Then
"O->Str1
ClrHome
FOr(A,1,16L)
Output(1,1,int(((A+1)/(16L))100
Str1+sub(" O ",randInt(1,3),1->Str1
End
End
---alternate types of random level generators---
End
If I=2
Then
1->A
ClrHome
Disp "Level?
Repeat K=105
Output(2,1,A
Repeat K
getkey->K
End
A-(K=34 and A!=1)+(K=25->A
Output(2,1,"_three spaces_
End
If A=1
"_level data_->Str1
If A=2
"_level data_->Str1
End
If I=1 or I=2
Then
1->_theta_
4->X
3->Y
20->R
int(length(Str1)/16)-6->L
Repeat _theta_=L or not(Y
Output(1,1,subStr1,16_theta_-15,128
Delvar M
Repeat K=34 or M=int(R
getkey->K
Output(Y,X,"_space_
If _theta_!=L
Then
16(_theta_+Y-1)-16+X->Z
J-(J!=0)+2(K=25 and not(J) and "0"=sub(Str1,Z+16,1->J
Output(1,15+(int(R)-M<10),int(R-M
If 10>int(R-M
Then
Output(1,15,"`
End
Y+(not(J) and Y!=8 and "0"!=sub(Str1,Z+16,1))-(J and Y!=1 and "0"!=sub(Str1,Z-16,1->Y
End
16(_theta_+Y-1)-16+X->Z
X+(K=26 and "0"!=sub(Str1,Z+1,1) and x!=16)-(K=24 and X!=1 and "O"!=sub(Str1,Z-1,1->X
Output(Y,X,"*
rand10
M+1->M
End
Y-1->Y
R-.5(3!=int(R->R
_theta_+(_theta_!=L->_theta_
End
CLrHome
If not(Y
Then
Output(1,3,"YOU LOSE
Else
Output(1,3,"YOU WIN
End
getKey
Repeat getKey
End
End
End
-
I was trying to code and wondered what "_level data_->Str1
is. what kind of level data do we have to put in?
-
a string that is divisable by 128 more then 8 times and is filled with anything
the letter O is solid tiles, and anything else is not.
-
okay i got it. it seems pretty fun, except sometimes with random you can get stuck even if you jump :P
-
Yeah that's due to randomly generated maps...you could make better maps, also you can't jump at the bottom off the screen if the tile under you isn't solid even if you are at the bottom of the screen
if you want you can try your hand at better map generators, Also could you upload a .8xp copy to here so others can just download it.
And if you wouldn't mind, could you possibly make a screenshot?
-
sure, i will make the screenshot and .8xp
Edit: attached, the attached program does not have levels except random generator.
Edit: The first trial of screen shot play was fail, due to random map.
The second trial, I have no idea why it gave me the invalid dim. It was fine in my calc, and i was able to win and stuff...
Gotta figure out why, and if i have time, i guess i'll optimize it and make the random generator better
-
Thanks! Looks great! Also I made another random level generator, I don't know if anybody wants to use it though since it's probably slower...but it's an alternate way to do it...
I'll post the code in a bit
oh yeah just in case nobody knew
[<][>]--move
[^]--jump
[\/]--shift screen manually
also what is the framerate on your screenshot? It's painfully slow on my iPod...
-
it's pretty fast, like 25 fps? It's the 2nd to right (next to 33 fps) in wabbitemu
-
Ah that's the problem, on an iPod the more fps the slower it is, how about making lower fps for on forums? And releasing the higher ones for in downloads?
Also the higher the fps is does not mean the faster it will e, it still runs at te same speed, fps ony effects quality
-
oh i was actually talking about output framerate.. yeah sorry about that.
Should I post 9 framerate one?
-
Sure it would be more bearable, also it would be erred for all those people on browsers other then ff and whichever it was that could handle faster screenshots
-
Okay here's the one with 9 framerate.
And I won this time!!! ;D
-
Thanks! Looks nice btw :)
hmmm, I had an idea on how to make an endless style of gameplay...
It would first make the screen and one more line in te screen, start on that, and then at each shift build a new line and delete the old line, it would slow it down quite a bit, but it would become endless :p
-
I am trying to find a way so that it will be solvable, without getting stuck. I have a vague idea and will have to test it out on calc.
-
Ok, well I had a thought on a way that could work, it would test to make sure there is one path open all the way, but I have no idea how to code it...
Can't wait to see your idea!
-
Looks nice! I'm glad you are still coding without your calc.
-
Thanks! Well I am using a calc, but it's my school calc, which my mom takes away when I get home....
-
I was trying to code endless falldown, but it was really slow...
I almost succeeded in eliminating impossible map, but then it wasn't 100% perfect.
I used this method:
I check the tile right above of the next line (eg: last line-> <b>O</b>OOOOO OOOOO OO O
and if there is something, 3/4 of time will be filled and 1/4 of time will be blank
and if there is blank space there, 3/4 of time will be blank and 1/4 of time will be filled, etc.
It gave me a map that will usually be possible for about 20~30 rows or even more, but then sometimes it wasn't. :(
So I'm trying a new method that will make the map first (like what you did) but also checks to make sure that there is a winning path
-
Ah cool, that's a good idea actually. How slow was it could I see some code I might be able to speed it up.
Well I can't wait to see your random map maker.
-
Haha I'm having a major slump in trying to code the random map maker...
And the code for endless goes like this:
:2->R
:Repeat not(Y
:"_space_->Str3
:DelVar M
:Repeat M=16
:Output(O,P,"_space_
:Output(Y,X,"*
:16Y-16+X->_theta_
:getKey->K
:If Y!=8
:Y+(Str2!=sub(Str1,_theta_+16,1->Y
:16Y-16+X->_theta_
:If K=24 and X>1
:X-(Str2!=sub(Str1,_theta_-1,1->X
:If K=26 and X<16
:X+(Str2!=sub(Str1,_theta_+1,1->X
:M+1->M
:sub(Str1,112+M,1
:If Ans=Str2
:Then
:Str3+sub(Str2+"_space_"+Str2+Str2+"_space_"+Str2+Str2+Str2,RandInt(1,R),1->Str3
:Else
:Str3+sub("_space_"+Str2+"_2space_"+Str2+"_3space_",RandInt(1,R),1->Str3
:End
:End
:R+int(R<8 and sub(M->R
:Y-1->Y
:O-1->O
:sub(Str1,17,112)+sub(Str3,2,16->Str1
:End
I didn't put jumping sequence in, because I actually deleted the program to get a fresh start on random map generator.
Anyways, the jumping sequence was buggy too.
Hope this helps
-
Hmm, well a few ways to speed it up is to get rid of those horribly slow if statements and switching to boolians...like in my code.
I'll have to take a closer look later to see if I can find more ways to speed it up.
-
ok I was able to get on a computer without my mom around with my calc, so here is the most recent copy of Fall
it has 4 methods of making a random map
2 included levels
updated the gameplay so that it will refresh the spot to whatever symbol you are on instead of just putting a space
also if you go over a * you win, and your character is a theta now instead of a * :P
-
nice I'll try to give this a try eventually. Feel free to upload in archives if you want
EDIT: Idk if I am doing something wrong but no matter what I input, it exits after doing the loading and just says "Done"
could u include instructions?
-
Really? Hmm screenshot?
It should work, but I might have miscounted the amount of End statements...sure I'll include instructions next time.
I'll upload it to the archives when I make my first level pack. Then people can make their levels as they want :)
oh and could someone make a screenshots of the first two levels :)
-
idk, maybe I'M just doing something wrong. This is why i am asking help on what i need to input
-
Well when you get to the menu just input the number to select the option and the press enter (it's using input if you didn't already gigure it out)
-
well you still didnt said what number i needed to type, for example for Method, but i figured 1 through 4 did something. Here's screenshot:
EDIT: fixed typo
-
You were right, that looks like I misplaced a End statement...could you sourcecode my program for me? I'm on my iPod...and it's easier on here to see program flow with it...
-
:ClrHome
:"OOOO
:Ans+Ans+Ans+Ans→Str1
:For(B,8,1,‾1)
:Output(B,10,"*
:rand10
:Output(B,1,Str1
:End
:For(A,0,2)
:Output(4+A,6,"
:End
:Output(5,6," FALL
:getKey
:Repeat getKey
:randInt(1,3,5
:Output(8,2,"<PRESS A KEY>
:randInt(1,3,5
:Output(8,2,Str1
:End
:Repeat not(I
:ClrHome
:Disp "0=QUIT","1=RAND","2=LVLS
:Input ":",I
:If I=1
:Then
:Input "METHOD: ",A
:Input "ROWS: ",L
:"O→Str1
:ClrHome
:If A=1:Then
:For(A,1,16L)
:Output(1,1,int(((A+1)/(16L))100
:Str1+sub(" O ",randInt(1,3),1→Str1
:End
:End
:If A=2
:Then
:For(A,1,L)
:Output(1,1,int(((A-1)/L)100
:randInt(1,3,16→L[size=8]1[/size]
:For(B,1,16)
:Output(2,1,int((B/16)100
:Str1+sub(" O ",L[size=8]1[/size](B),1→Str1
:End
:ClrHome
:End
:sub(Str1,2,length(Str1)-1→Str1
:End
:If A=3:Then
:randInt(1,2,16→L[size=8]2[/size]
:L[size=8]2[/size]→L[size=8]1[/size]
:For(A,1,L)
:Output(1,1,int(((A-1)/L)100
:For(B,1,16)
:Output(2,1,int((B/16)100
:If 1=L[size=8]2[/size](B
:Then
:If 2≠randInt(1,3
:Then
:1→L[size=8]1[/size](B
:Else
:2→L[size=8]1[/size](B
:End
:Else
:If 2=randInt(1,2
:Then
:2→L[size=8]1[/size](B
:Else
:1→L[size=8]1[/size](B
:End
:End
:Str1+sub(" O",L[size=8]1[/size](B),1→Str1
:End
:Output(2,2,"
:L[size=8]1[/size]→L[size=8]2[/size]
:End
:sub(Str1,2,length(Str1)-1→Str1
:End
:If A=4
:Then
:If L>63
:Then
:Pause "ERROR
:"
:Ans+Ans
:Ans+Ans+Ans+Ans
:Ans+Ans+Ans+Ans+Ans
:Ans+Ans→Str1
:Else
:ClrDraw
:For(A,1,L)
:For(B,1,16)
:Str1+sub(" OO ",randInt(1,6)+randInt(1,6),1→Str1
:If "O"=sub(Str1,length(Str1),1
:Then
:Pxl-On(A-1,B-1
:End:End
:End
:End
:If I=2
:Then
:1→A
:ClrHome
:Disp "LEVEL?
:Repeat K=105
:Output(2,1,A
:Repeat K
:getKey→K
:End
:A-(K=34 and A≠1)+(K=25→A
:Output(2,1,"
:End
:prgmLVL
:End
:If I=1 or I=2
:Then
:1→θ
:4→X
:3→Y
:20→R
:int(length(Str1)/16)-6→L
:Repeat θ=L or not(Y) or "*"=sub(Str1,Z,1
:Output(1,1,sub(Str1,16θ-15,128
:DelVar M
:Repeat K=34 or M=int(R) or "*"=sub(Str1,Z,1
:getKey→K
:Output(Y,X,sub(Str1,16(Y+θ-2)+X,1
:If θ≠L-1
:Then
:16(θ+Y-1)-16+X→Z
:J-(J≠0)+2(K=25 and not(J) and "O"=sub(Str1,Z+16,1→J
:Output(1,15+(int(R)-M<10),int(R-M
:If int(R-M)<10
:Then
:Output(1,15,"∙
:End
:Y+(not(J) and Y≠8 and "O"≠sub(Str1,Z+16,1))-(J and Y≠1 and "O"≠sub(Str1,Z-16,1→Y
:If Y=8 and "O"≠sub(Str1,Z+16,1
:Then
:int(R)-1→M
:End
:End
:M+1→M
:16(θ+Y-1)-16+X→Z
:X+(K=26 and "O"≠sub(Str1,Z+1,1) and X≠16)-(K=24 and X≠1 and "O"≠sub(Str1,Z-1,1→X
:Output(Y,X,"θ
:rand10
:End
:Y-1→Y
:R-.5(3≠int(R→R
:θ+(θ≠L→θ
:End
:ClrHome
:If not(Y
:Then
:Output(1,3,"YOU LOSE
:Else
:Output(1,3,"YOU WIN
:End
:End
:Pause
:End
Generated by SourceCoder (http://www.cemetech.net/projects/basicelite/sourcecoder.php), © 2005 Cemetech (http://www.cemetech.net)
:If A=1
:"O//////////////OO//////////////OO/////////OOOOOOOOOOOOOO/+OTOTOOOTTTTOO/++OTOTOOOTTTTOO+++OTOTOOOTTTTOO+++OTOTOOOOOOOOOOO+OOOOOOO+T+T+T+T+T+T+TOOOOOOOOOOOOOOOTOO+T+T+T+T+T+T+TOO+T+T+T+T+T+T+TOO+OOOOOOOOOOOOOOO+OOOOOOOOOOOOOOO++++++++++++++OO++++++++++++++OO++++++++++++++OOLOBSTERRETSBOLOOOOOOOO OOOOOOOO O O OO O O OO O O OO O O OO O O OO O O OO O O OOOOOOOOO O OO O O OO O OOOOOOOOO O O OO OOOOOOOOOOOOOOO OO
:If A=2
:"////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////O//////////////OOO////////////OOOOO//////////OOOOOOO////////OOOOOOOOO//////OOOOOOOOOOO////OOOOOOOOOOOOO//OOOOOOOOOOOOOO/ OOOOOOOOOOOOOO OOOOOOOOOOOOO OOOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOO OOOOOOOO O OOOOOOOO O OOOOOOOO O OOOOOOO O OOOOOO O OOOOOO- O OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO O O OOOOOOOOOOO O O OOOOOOOOOO O O OOOOOOOOOOO O O OOOOOOOOOOO OOOOOOOOOOO OOOOOOOOOOOOOOO O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O OO O O O O O O O O O O O O OO O O O O O O O O O O O O OOO OOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOOOO OOOOOOOOOOOOO→Str1
:
Generated by SourceCoder (http://www.cemetech.net/projects/basicelite/sourcecoder.php), © 2005 Cemetech (http://www.cemetech.net)
EDIT: mhmm, nethams...
-
Thanks! I'll look through it
lol, you saw that did you? :p
-
yeah i spotted it quite fast too :P
-
Lol, I put that in just for you dj :p
-
well I couldn't figure out why it did that....:/ but I fixed it by separating the random level generators into a separate program
EDIT: also added another level
-
That seems to work better now, despite some bugs, but awesome game btw
-
Thanks! What are the bugs you mentioned btw?
-
They're in the screenshot. One is an ERR:DOMAIN when jumping too high at the top of map. ANother is getting stuck at the beginning once
-
Ah...forgot to put a check in for that first one, as for getting stuck, what happened? Like, which map, and such.
-
as you can see in the screenshot, I got stuck in a randomized level, using method 3 with 14 rows
-
Yeah it's a randomized error, only 14 rows? That's kind of small...
I also didn't watch the full screenshot, it's kind of too slow on my iPod at that quality
Edit: I actually just found a gif viewer that will play it at full speed! It doesn't handle the gifs on the front page well though, but it handles yours just fine
-
yeah i didnt felt like waiting a minute for loading since it was to make an animated screenshot :P
-
Ah lol :p
-
Hmmm. interesting.
How did you manage the random section? what differences are there between each method?
*jsj795 feels lazy to look at the code right now
-
It was like this
input A
If A=1
Then
-method 1-
End
If A=2
Then
-method 2-
End
-etc-
each one uses different ways to do it. The first one has a 33% chance of placing a solid tile, and a 66% chance of putting a non-solid tile. The second one is pretty much the same, just a different method (uses a list to speed up part of it). The third one is "smart" about it, it has different chances (can't remember off the top of my head). The last one updates to the graphscreen, drawing a minimap, and it also is "rolling" two dice, so there is probability involved. The solid tile is on 6 and 5 so it has one of the most common hit, and one that is hit a lot, but the rest are not solid. So it makes a good map usually. My favorite is 3, but I like the minimap on 4.
-
Great quality game. How big is it?
-
Thanks! I don't actually know the size, you'd have to combine the sizes of all three programs.
-
it's actually not too bad, I also like how it supports external levels.
-
well here is the one that fixes the jump off the top error, and level four :D
-
Ok I will try when i have some time and feel less half asleep
-
Ah ok, well level four is easy if you figure out what the non-solid tiles are trying to tell you :p
-
Well I've made a better menu system to make it easier to use, and now for selecting random methods is like selecting levels. Also I'm going to make the rows option better...
I've also added another level, and as soon as I get access to the computer I'll upload it...soon I'll add a storyline of sorts and make some real levels, and then prep it for release.
EDIT: Here it is and I'll include a screenshot if I can
EDIT: here is the screenshot
-
Looks great! The storyline should be cool.
-
thanks! Any suggestions on what I should do for the story?
-
No, I wish I had some though. Mabey you're trapped at the top of a tall tower...
-
Hmm possibly, I'll have to do some thinking...
-
That looks nice ^^
-
Thanks! I also forgot to mention that when you die it show how far you got.
-
I don't know that it really needs a story. It looks pretty nice though regardless!
-
Thanks! Well I'd rather have a story so that people will have more reason to play it.