Im trying to create kind of a 2d minecraft, using identity( sprite commands, but it runs extreamly slow. any ideas why?
In order to help, we're going to need some more info. Do you have screenshots, executable, source code you could upload? It would help quite a bit
look it up in google and here in cemetech
some of the persons created already sth like this...
maby you can look up their codes to make a better performance...
which calc?
Sorry for the lack of knowlage on how to use this website... Smile
How do I load the program on here?
you must ask a admin to do this
I believe Spyro was asking you to dump the "text" of the program into the forum, not to upload the program to the archives. as for screenshots, the use of an emulator is very helpful.

Im guessing this is in Ti-Basic? you could just add a 'SavePic #' command somewhere in the code, and then use Ti's 8xi->jpg converter. Also, are you using any libraries? as for the program being slow, some things cannot be helped. it is Ti Basic, after all.

also, have you by chance read Kerm's book, Programming the Ti 83/Ti 84 plus? it is a huge source of information about Ti Basic programming.
http://sc.cemetech.net

Load your program into this, let it parse it out, and copy the code into a post, surrounded by [ code] [ /code] tags, without spaces.
I have Kerm's book, that's where the identity comes from. I'm using hybrid libs, and the way I set up the program, it would be almost imposible to save it in pic form.
Here

Code:
:ClrDraw
:ClrHome
:AxesOff
:FnOff
:CoordOff
:ZFrac1/4
:Lbl MU
:Menu("MINELIFE","PLAY",PL,"HELP",HE,"QUIT",QU
:Lbl QU
:ClrHome
:Disp "MINE LIFE v1.0"
:Disp "MADE BY:"
:Disp "AARON ROTH"
:Archive[G]
:Archive∟MLIFE
:Archive∟CHEST
:StorePic 1
:DelVar Pic1
:ClrDraw
:ClrHome
:Stop
:Lbl HE
:
:
:
:
:Goto MU
:Lbl PL
:ClrDraw
:ClrHome
:SetUpEditor ∟MLIFE,CHEST
:15→dim(∟MLIFE
:Output(1,6,"PLAY"
:Output(4,4,"1:NEW"
:If ∟MLIFE(1)=1
:Output(5,4,"2:CONTINUE"
:Repeat θ
:getKey→θ
:End
:If θ=93
:Goto CO
:Lbl NE
:Menu("SURE?","NO",PL,"YES",YT
:Lbl YT
:{1,1}→dim([G])
:DelVar [G]
:DelVar ∟MLIFE
:DelVar ∟CHEST
:SetUpEditor ∟MLIFE,CHEST
:15→dim(∟MLIFE
:30→dim(∟CHEST
:ClrHome
:Disp "BUILDING LEVEL,","PLEASE WAIT..."
:{30,50→dim([G]
:For(A,5,30
:For(B,1,50
:rand→C
:If C>.5
:1→D
:If C<.5
:2→D
:D→[G](A,B
:End
:End
:ClrHome
:Disp "ADDING ELEMENTS"
:randInt(5,15)→Q:For(K,1,Q)
:Lbl EL
:randInt(5,25)→A:randInt(1,45)→B:randInt(A,A+7)→C:randInt(B,B+7)→G
:If G>50 or C>30:Goto EL
:For(Z,A,C
:For(W,B,G
:9→[G](Z,W
:End
:End
:End
:ClrHome
:Disp "ADDIND GEMS"
:For(E,1,400)
:randInt(10,30)→A:randInt(1,50)→B
:rand→F
:If F<.5
:Then
:rand→H
:If H<.4
:3→D
:If H>.4 and H<.8
:10→D
:If H>.8
:11→D
:End
:If F>.5 and F<.7
:6→D
:If F>.7 and F<.9
:5→D
:If F>.9 and F<.97
:12→D
:If F>.97
:7→D
:D→[G](A,B)
:End
:ClrHome
:Disp "ADDING CAVES"
:randInt(5,9)→U:For(H,1,U)
:randInt(5,45)→B:randInt(10,25)→A:randInt(5,15)→R:For(K,1,R)
:Lbl CA
:rand→I
:If I<.25
:A+1→A
:If I≥.25 and I<.5
:A-1→A
:If I≥.5 and I<.75
:B-1→B
:If I≥.75
:B+1→B
:If A>29 or B>49 or A<6 or B<2
:Goto CA
:0→[G](A,B)
:End
:End
:For(A,5,30
:For(B,1,50
:If [G](A,B)=0 and A-1≠0 and B-1≠0 and A-1≠16 and A-1≠17 and B-1≠16 and B-1≠17
:17→[G](A,B)
:If [G](A,B)=0 and A-1≠0 and B+1≠0 and A-1≠16 and A-1≠17 and B+1≠16 and B+1≠17
:16→[G](A,B)
:End
:End
:randInt(10,50)→A
:8→[G](4,A
:ClrHome
:1→∟MLIFE(1)
:0→∟MLIFE(2)
:ClrHome
:Archive[G]
:Archive∟MLIFE
:Archive∟CHEST
:Disp "DONE"
:Pause
:
:
:Lbl CO
:ClrHome
:Disp "LOADING"
:UnArchive[G]
:For(A,1,30
:For(B,1,50
:If [G](A,B)=15
:Goto LV
:End
:End
:Lbl P
:randInt(6,44)→B:4→A
:If [G](A,B)≠0
:Goto P
:26→E
:0→G
:
:
:Lbl LV
:Repeat [G](A+1,B)≠0
:A+1→A
:End
:
:Lbl II
:If [G](A,B)=8
:Then
:1→∟MLIFE(2)
:0→[G](A,B)
:End
:
:Lbl ID
:For(C,A-4,A+3)
:3→F
:For(D,B-5,B+5)
:If [G](C,D)=0
:identity(5,"0000000000000000",F,G,1,8,0,0,0
:If [G](C,D)=1
:identity(5,"AA55AA55AA55AA55",F,G,1,8,0,0,0
:If [G](C,D)=2
:identity(5,"5FF55FF55FF55FF5",F,G,1,8,0,0,0
:If [G](C,D)=3 or [G](C,D)=10 or [G](C,D)=11
:identity(5,"F789898E89D1A1FF",F,G,1,8,0,0,0
:If [G](C,D)=4
:identity(5,"00007CAA54281000",F,G,1,8,0,0,0
:If [G](C,D)=5
:identity(5,"3C4299BDBD99423C",F,G,1,8,0,0,0
:If [G](C,D)=6
:identity(5,"3C425A5A5A5A423C",F,G,1,8,0,0,0
:If [G](C,D)=7
:identity(5,"00007E85FDB585FE",F,G,1,8,0,0,0
:If [G](C,D)=8
:identity(5,"3C7E991818181818",F,G,1,8,0,0,0
:If [G](C,D)=9
:identity(5,"FFFFFFFFFFFFFFFF",F,G,1,8,0,0,0
:If [G](C,D)=15
:identity(5,"0000010107FF8181",F,G,1,8,0,0,0
:If [G](C,D)=18
:identity(5,"00060F0F96FF6FFF",F,G,1,8,0,0,0
:If [G](C,D)=16 or [G](C,D)=17
:Then
:If [G](C,D)=16
:Then
:0→H
:Else
:1→H
:End
:identity(5,"53AC50A040408080",F,G,0,H,0
:End
:F+8→F
:End
:G+8→G
:End
:If E=26
:0→I
:If E=24
:1→I
:If ∟MLIFE(2)=1
:identity(5,"60B09663F56860B0",43,24,1,8,0,I,1
:If ∟MLIFE(2)=0
:identity(5,"182C24183C18182C",43,24,1,8,0,I,1
:
:
:Lbl BC
:StorePic 1
:Repeat K
:Text({-}1,0,90," "
:getKey→K
:End
:If K=15
:Then
:Menu("PAUSE","MINE",MI,"BUILD",BU,"QUIT",QU,"BACK",BC
:Lbl MI
:0→L
:RecallPic 1
:Goto BC
:Lbl BU
:1→L
:RecallPic 1
:Goto BC
:End
:
:If K=83
:Then
:If [G](A,B+1)=7 or [G](A,B-1)=7:Then
:ClrDraw
:ClrHome
:Text(0,0,"DIRT":Text(6,0,"COPPER ORE"
:Text(12,0,"IRON ORE"
:Text(18,0,"GOLD ORE"
:Text(24,0,"DIAMOND"
:Text(30,0,"EMERALD"
:Text(36,0,"RUBY"
:Text(42,0,"SAND"
:Text(48,0,"SPIDER WEB"
:Text(54,0,"ROCK"
:Text(60,0,"GLASS"
:Text(0,12,∟CHEST(1
:Text(6,12,∟CHEST(10
:Text(12,12,∟CHEST(3
:Text(18,12,∟CHEST(11
:Text(24,12,∟CHEST(4
:Text(30,12,∟CHEST(6
:Text(36,12,∟CHEST(5
:Text(42,12,∟CHEST(9
:Text(48,12,∟CHEST(16
:Text(54,12,∟CHEST(2
:Text(60,12,∟CHEST(11
:Repeat J
:getKey→J
:End
:RecallPic 1
:Goto BC
:End
:If [G](A,B+1)=18 or [G](A,B-1)=18
:Then
:
:
:
:
:
:
:
:RecallPic 1
:Goto BC
:End
:End
:If K=24
:Then
:B-1→B
:K→E
:Goto LV
:End
:If K=26
:Then
:B+1→B
:K→E
:Goto LV
:End
:If K=25
:Then
:If [G](A+1,B)=0 and [G](A+2,B)=0 and [G](A+3,B)=0
:Then
:If A-3<1
:Then
:3-A→M
:A-M→A
:Else
:A-3→A
:End
:End
:Goto II
:End
:If K=82 or K=84 or K=92 or K=94:Then
:If L=0 and ∟MLIFE(2)=1
:Then
:If K=82
:Then
:[G](A,B-1)→N
:If N=15 or N=7 or N=18
:Goto BC
:∟CHEST(N)+1→∟CHEST(N)
:0→[G](A,B-1
:Goto II
:End
:If K=84
:Then
:[G](A,B+1)→N
:If N=7 or N=15 or N=18
:Goto BC
:∟CHEST(N)+1→∟CHEST(N)
:0→[G](A,B+1
:Goto II
:End
:If K=92
:Then
:[G](A+1,B-1)→N
:If N=7 or N=15 or N=18
:Goto BC
:∟CHEST(N)+1→∟CHEST(N)
:0→[G](A+1,B-1
:Goto II
:End
:If K=94
:Then
:[G](A+1,B+1)→N
:If N=7 or N=15 or N=18
:Goto BC
:∟CHEST(N)+1→∟CHEST(N)
:0→[G](A+1,B+1)
:Goto II
:End
:End
:If L=1
:Then
:
:
:
:
:
:
:
:
:Goto II
:End


This is what I have so far... I finally kind of gave up on this idea. Help would be nice.
tifreak8x recommended code tags; make sure you use them! Anyway, you seen to have a decent start here, but you're going to have to be more specific than asking for "help". What sort of help are you looking for? Ideas on features to add? A specific programming detail that you're stuck on?
bug:first time players who do not play the game, but immediatly exit, would get a nonexistant error with the following:
[G]
list(MLIFE)
list(CHEST)

no point in Exit>
StorePic 1
DelVar 1

Lbl HE is followed by needless blankspace, and then just hits another goto. however, looking at your menu, its just a placeholder, isnt it?

You also forgot to put the entire code in code brackets

ill scan for other improvements later.
Sorry for that, right now the help is just a place holder.
I think my first problem is that this program is excessivly slow...
I would probably exit too. Some other problems are movment, and accessing the chest. I hope to be able to finish it soon, and have it run at a rate that won't put you to sleep, or wonder if your calculator has crashed.
I started this project about a year ago, back before I knew some of the programming tricks. I didn't know quite what I was doing, except for the fact that I knew kind of what I wanted this program to do. I'll try to take the chance to fix some of the things in this program, but I'm not sure how to make it run faster and still do somewhat the same thing.
well, this is in Ti-Basic. besides some of Kerm's optimisations from his book, i really think you would have to learn z80, or at least use more libraries and prebuilt ASM, in order to speed it up. at the same time, what you do have is very well written, and certainly a good foothold of what Ti Basic is capable of.
Are there any parts that by editing the code would garantee a faster preformance? little parts that I could change?
not that i can see. i think that your pretty landlocked with as good as you get, but see if Kerm or someone with a fresh eye can look over it. i may have missed some thing or two.
I know that when I run the program on my calculator and try to move left or right, he drops like 4 or 5 levels into the ground, and idk why.
...let me actually run the code sometime, but sounds like the variable(s) for char_X and char_Y are being confused.
That could be the problem. How do I load a rom image to the online emulator? I get to the load rom screen and I can browse for one but idk what to do after that.
do you have a rom? get the rom tools (idk where it is right now, but wabbit will download them for you) and dump your calc rom. tthen browse for it and get your Emu to work.
I have a rom already, my problem is loading it.
  
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 2
» 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