So, alexgt over on codewalrus has let me port his Nagoji 4x3 game to the TI 84+ CSE!
-------------------------------------------------------------------------------------

And it is now done! Smile

You can download it from the archives, here.




-------------------------------------------------------------------------------------

Here is a video showing what the HP Prime version looks like.



Oh yeah, and its made with xlibc Wink

Code:
Repeat Ans=45 or Ans=92 or Ans=93 or Ans=94 or Ans=82

could be

Code:
Repeat min(Ans={45,92,93,94,82


Code:
Repeat K=15
real(2,0,0
Ans->K

could be

Code:
Repeat K=15
real(2,0->K


Code:
If C=3
real(7,9,A,0,40,120,D,0
If C=2
real(7,9,A,40,40,80,D,0
If C=1
real(7,9,A,0,40,80,D,0
rand(B
If C=3
real(7,9,A,0,40,120,F,0
If C=2
real(7,9,A,40,40,80,F,0
If C=1
real(7,9,A,0,40,80,F,0

could be

Code:
real(7,9,A,0+40(C=2),40,80+40(C=3),D
rand(B
real(7,9,A,0+40(C=2),40,80+40(C=3),F

using the sme method, you could do the same with this

Code:
If C=2
real(7,9,A,40,40,80,D,0
If C=1
real(7,9,A,80,40,40,D,0
rand(B
If C=2
real(7,9,A,40,40,80,0,0
If C=1
real(7,9,A,80,40,40,0,0

and make it

Code:
real(7,9,A,40+40(C=1,40,40+40(C=2),D
rand(B
real(7,9,A,40+40(C=1,40,40+40(C=2),0
Thanks for those mr womp womp!

Player squares are working, and I have a screenshot! There is no movement yet :\



Current code:


Code:

real(0,1,1
real(8,1,0
Lbl H
real(0,3,4,0,0
"Nagoji:
real(6,0,23,5,66,36,0
"4x3
real(6,0,83,5,16,36,0
"CSE
real(6,0,113,5,224,36,0
16->B:1->C:160->A
Repeat max(Ans={45,92,93,94,82
"1.Play 2.Help
real(6,0,27,17,5,61,0
"3.Info 4.Quit
real(6,0,27,25,5,61,0
A-40->A
real(7,9,A,40+40(C=1),40,40+40(C=2),D
rand(B
real(7,9,A,40+40(C=1),40,40+40(C=2),0
If not(A:Then
160->A
B-1->B
randInt(1,255->D
randInt(1,2->C
End
If not(B
16->B
getKey
End

Ans->K
DelVar G

If K=45
Goto X

If K=92:Then
real(0,3,4,0,0
16->B:1->E:40->J:40->L:80->M:255->N
DelVar FDelVar HDelVar IRepeat K=15
Repeat K=15
real(2,0->K
H+1->H
A-40->A
real(7,9,I,J,L,M,N,0
real(7,9,A,0+40(C=2),40,80+40(C=3),D
rand(B
real(7,9,A,0+40(C=2),40,80+40(C=3),F
If not(A:Then
160->A
B-E->B
If H>=100:Then
randInt(0,255->F
real(0,3,4,F,0
End
If H>=28:Then
randInt(1,255->D
randInt(1,255->N
End
randInt(1,3->C
End
If not(B:Then
1->B
DelVar E
End
If F=D
randInt(0,255->D
End
End
If K=93:Then
real(0,3,4,0,0
"How to play=Up arrow to jump=Down arrow to slide=Right arrow to SMASH!==The point of the =game is to get=through as many=obstacles as=possible,=traversing through=multiple levels of=different=difficulties and=themes.
real(6,0,0,5,255,61,0
Repeat getKey
End
1->G
End
If K=94:Then
real(0,3,4,0,0
"This game was first=envisioned by alexgt=for The Codewalr.us=4x3 Contest. It was=made for the HP=Prime, and now, the=TI-84+ CSE by=Unicorn.
real(6,0,0,5,255,61,0
Repeat getKey
End
1->G
End
If G
Goto H
Lbl X
real(0,1,1
real(0,3,4,255,1
real(0,3,4,255,0
Stop

Code:
"1.Play 2.Help
real(6,0,27,17,5,61,0
"3.Info 4.Quit
real(6,0,27,25,5,61,0

you could use the newlinechars...

Code:
"1.Play 2.Help/3.Info 4.Quit
real(6,0,27,17,5,47

Although, If I were you, I would maybe make a menu with the arrow keys if you're willing to spare a few bytes since it is a game, and I think arrow key menus looks nicer...
Here is a version with a custom menu using the arrow keys just for fun Razz It required some minor modifications to the rest of the program (it was no longer checking for a keypress, but rather, some rudimentary 2-bit coordinate system) So here is the entire program with the tweaks.

Code:
real(0,1,1
real(8,1,0
Lbl H
real(0,3,4,0
"Nagoji:
real(6,0,23,5,6,36
"4x3
real(6,0,83,5,16,36
"CSE
real(6,0,113,5,224,36
160->A
"Play Help/Info Quit
real(6,0,43,17,5,47
1->Q:1->R:Repeat max(K={21,105,45
">
real(6,0,40R-5,9+8Q,15
real(6,0,40R-6,9+8Q,10
Repeat K
A-40->A
real(7,9,A,40+40(C=1),40,40+40(C=2),D
real(7,9,A,40+40(C=1),40,40+40(C=2),0
If not(A:Then
160->A
B-1->B
randInt(1,255->D
randInt(1,2->C
End
If not(B
16->B
getKey->K
End
">
If max(K={25,34:Then
real(6,0,40R-5,9+8Q,0
real(6,0,40R-6,9+8Q,0
End
Q+(K=34)-(K=25->Q
Q-2(Q=3)+2not(Q->Q
If max(K={24,26
">
real(6,0,40R-5,9+8Q,0
real(6,0,40R-6,9+8Q,0
R+(K=26)-(K=24)->R
R-2(R=3)+2not(R->R
End
DelVar GIf K=45
Goto X
If R=1 and Q=1:Then
real(0,3,4,0
16->B:1->E
DelVar FDelVar HRepeat K=15
Repeat K=15
real(2,0->K
H+1->H
A-40->A
real(7,9,A,0+40(C=2),40,80+40(C=3),D
rand(B
real(7,9,A,0+40(C=2),40,80+40(C=3),F
If not(A:Then
160->A
B-E->B
If H>=100:Then
randInt(0,255->F
real(0,3,4,F
End
If H>=28
randInt(1,255->D
randInt(1,3->C
End
If not(B:Then
1->B
DelVar E
End
If F=D
randInt(0,255->D
End
End
If R=2 and Q=1:Then
real(0,3,4,0
"How to play=Up arrow to jump=Down arrow to slide=Right arrow to SMASH!==The point of the =game is to get=through as many=obstacles as=possible,=traversing through=multiple levels of=different=difficulties and=themes.
real(6,0,0,5,255,61
Repeat getKey
End
1->G
End
If R=1 and Q=2:Then
real(0,3,4,0
"This game was first=envisioned by alexgt=for The Codewalr.us=4x3 Contest. It was=made for the HP=Prime, and now, the=TI-84+ CSE by=Unicorn.
real(6,0,0,5,255,61
Repeat getKey
End
1->G
End
If G
Goto H
Lbl X
real(0,1,1
real(0,3,4,255,1
real(0,3,4,255
Return

Oh and you might want to use Return instead of Stop since Return will send you back to Doors.
Oh wow, thanks! I was going to implement an interactive menu anyways, andI had the numbers just to have a menu working Smile

Oh yeah, what variables did you use/add? I have used all up to N, I think.
Unicorn wrote:
Oh wow, thanks! I was going to implement an interactive menu anyways, andI had the numbers just to have a menu working Smile

Oh yeah, what variables did you use/add? I have used all up to N, I think.

I added Q and R and didn't mess with your other vars, but it could be easily changed to use whatever variable you want it to use...
Ok, good. I need to formulate a list of them and what they do, eventually. (more like in 8 hours or so) Razz

f you want to mess around with untested code: https://usercontent.irccloud-cdn.com/file/jo0RmCUE/NAGOJI.8xp


So i have run in to a problem. The rand( delay in the code above for removing the sprites slower is causing the getkey to not register. I sthere any other way to delay that? Use the above code.
So, what I understand is that you need a delay on certain objects, without hindering the user input response time. You need the getkey to update the player ~immediately, which means you can obviously not use the rand() command, since rand() is global and not just local to certain objects.

So, an example of fixing this can be found in my Basic Avalanche Plus Game:
Code:
//.5->S to initialize speed value

For(C,1,8,S   //the loop increments by a fraction
getKey->K
Output(iPart(C),B,Str0   

//str0 = falling objects. since ipart(C) is used, and S is a fraction, this line will execute several times before updating the graphical display of the object. and thus, that's how the delay in the object is caused without hindering getkey response time.

Output(8,A,"pi   //the player
If K
Output(8,A,"
A+(K=26)(A<5)-(K=24)(A>2->A
If K=45:8->C
Output(iPart(C),B,"
End
S+.01(S<1->S   //this line is outside of the for() loop, in a repeat loop that chooses a new falling object. This increases the speed at which the objects fall. I put in S<1 so that the game wouldn't become impossible.

So basically, the player movement code and getkey are run many times, allowing the player to move whenever without being hindered by a rand(). The object being delayed doesn't use rand(), but instead depends on iPart(<y coordinate>), and y coordinate is any value between 1 and 8 with a difference of S, the speed value, which increases each time a new object falls.

Hope this helps! Tell me if you need me to help a bit more.
I thought this might work, but it appears that it will not. A litte more explaination: I use the rand( call to delay the erasing of the rectangles. How can I get those rectangles to delay without the rand? Unless your code does work and I can't figure it out. X.X
Well, I was entirely overthinking this, all I needed was a new variable and an if statement. Razz Anyways, once the kinks of this change is worked out, movement will be implemented.

EDIT: Thw kinks have been worked out, now to do the movement! And the Evil or Very Mad moves r now being codes! Smile
*bump*
I have player movement pretty much down, except for erasing the trails when the player goes back to starting position. Just a little status update, and I'll post the code once I have the player movement working Wink
Cool. So you were able to use my method in a way?
Update: Progress has resumed!

I have the entire game engine done, except for collision detecting. Movement does get a little slow occasionally, but that is to be expected. To account for that delay, I will add a 3 lives until the game ends.

Anyways, a screenshot!



Now, I just have to do lives and collision detecting, and then I will release it! I won't be doing levels just yet, as I have a few other projects going on.
Bumpdate:

So, I've ran into a bit of a problem, for some reason whne the ser selects Info or Help, it just quits the game. I've looked at it on and off for a few days, and I can't figure it out.

Maybe mr womp womp will know? Anyways, code, and screenshot showing it.

(The syntax error was a Trace where a real( should be)




Code:

real(0,1,1
real(8,1,0
SetUpEditor ʟNAG
If not(dim(ʟNAG
{0→ʟNAG
Lbl H
ʟNAG(1→Z
real(0,3,4,0
"Nagoji:
real(6,0,23,5,252,36
"4x3
real(6,0,83,5,16,36
"CSE
real(6,0,113,5,224,36
160→A
"Play Help/Info Quit
real(6,0,43,17,5,47
"High:
real(6,0,43,35,196,0
real(6,1,85,35,196,Z,0
DelVar V
1→Q:1→R:16→B:Repeat max(K={21,105,45
">
real(6,0,40R-5,9+8Q,15
real(6,0,40R-6,9+8Q,10
Repeat K
A-40→A
real(7,9,A,45+40(C=1),40,35+40(C=2),D
rand(B
real(7,9,A,45+40(C=1),40,35+40(C=2),0
If not(A:Then
160→A
B-1→B
randInt(1,255→D
randInt(1,2→C
End
If not(B
16→B
getKey→K
End
If max(K={25,34:Then
">
real(6,0,40R-5,9+8Q,0
real(6,0,40R-6,9+8Q,0
End
Q+(K=34)-(K=25→Q
Q-2(Q=3)+2not(Q→Q
If max(K={24,26
">
real(6,0,40R-5,9+8Q,0
real(6,0,40R-6,9+8Q,0
R+(K=26)-(K=24)→R
R-2(R=3)+2not(R→R
End
If K=45 or R=2 and Q=2
Goto X
If R=1 and Q=1:Then
real(0,3,4,0
1→V:3→E:160→A:40→M:40→I:80→J
DelVar FDelVar HDelVar BDelVar Z
Repeat K=15
Z+1→Z
real(2,0→K
H+1→H:B+.5→B
If E≤0
.5→E
If K=2:Then
80→M:80→I:40→J
2→θ:2→W
End
If K=3:Then
80→I:40→J
3→θ:3→W
End
If K=4:Then
DelVar M
4→θ:4→W
End
real(7,9,0,M,I,J,5,0
If K=2
real(7,9,0,40,40,40,F
If K=3 or K=4
real(7,9,0,80,40,40,F
If B=E
A-40→A
real(7,9,A,0+80(C=2),40,80+40(C=3),D
If B≥E:Then
A+40→A
real(7,9,A,0+40(C=2),40,80+40(C=3),F
DelVar B
A-40→A
real(7,9,0,40,40,80,5,0
If θ=2
real(7,9,0,80,80,40,0,0
If θ=3
real(7,9,40,40,40,40,0,0
If θ=4
real(7,9,0,0,40,40,0,0
40→I:40→M:40→J
DelVar θ
End
If A=160
DelVar W
If C=3 and W≠3 and not(A:Then
15→K
1→V
End
If C=2 and W≠4 and not(A:Then
15→K
1→V
End
If C=1 and W≠2 and not(A:Then
15→K
1→V
End
If not(A:Then
real(7,9,A,0+40(C=2),40,80+40(C=3),F
E-.5→E
160→A
If H≥130:Then
randInt(0,255→F
DelVar θ
End
If H≥58
randInt(0,255→L
randInt(1,255→D
randInt(1,3→C
End
If F=D
randInt(0,255→D
End
If V=1:Then
real(0,3,4,0,0
"YOUR SCORE IS:
real(6,0,1,1,255,0
real(6,1,122,1,255,Z,0
If max(ʟNAG<Z:Then
Repeat K
real(2,0,0→K
"YOU GOT A HIGH SCORE!
real(6,0,1,9,R,0
randInt(1,255→R
End
{Z→ʟNAG
End
Repeat K
real(2,0,0→K
End
Repeat getKey
End
DelVar Z
1→G
End
If R=2 and Q=1:Then
real(0,3,4,0
"How to play:=Up arrow to jump=Down arrow to slide=Right arrow to SMASj`=The point of the=game is to get=through as many=obstacles as=possible,=traversing through=μltiple levels of=different=difficulties and=themes.
real(6,0,0,5,255,61
Repeat getKey
End
1→G
End
If R=1 and Q=2:Then
real(0,3,4,0,0
"This game was first=envisioned by alexgt=for The Codewalr.us=4x3 Contest. It     was=made for the HP=Prime, and now, the=TI-84+ CSE by=Unicorn.
real(6,0,0,5,255,61
Repeat getKey
End
1→G
End
If G
Goto H
Lbl X
real(0,1,1
real(0,3,4,255,1
real(0,3,4,255
Return
Unicorn wrote:
Bumpdate:

So, I've ran into a bit of a problem, for some reason whne the ser selects Info or Help, it just quits the game. I've looked at it on and off for a few days, and I can't figure it out.

Maybe mr womp womp will know? Anyways, code, and screenshot showing it.

(The syntax error was a Trace where a real( should be)




Code:

real(0,1,1
real(8,1,0
SetUpEditor ʟNAG
If not(dim(ʟNAG
{0→ʟNAG
Lbl H
ʟNAG(1→Z
real(0,3,4,0
"Nagoji:
real(6,0,23,5,252,36
"4x3
real(6,0,83,5,16,36
"CSE
real(6,0,113,5,224,36
160→A
"Play Help/Info Quit
real(6,0,43,17,5,47
"High:
real(6,0,43,35,196,0
real(6,1,85,35,196,Z,0
DelVar V
1→Q:1→R:16→B:Repeat max(K={21,105,45
">
real(6,0,40R-5,9+8Q,15
real(6,0,40R-6,9+8Q,10
Repeat K
A-40→A
real(7,9,A,45+40(C=1),40,35+40(C=2),D
rand(B
real(7,9,A,45+40(C=1),40,35+40(C=2),0
If not(A:Then
160→A
B-1→B
randInt(1,255→D
randInt(1,2→C
End
If not(B
16→B
getKey→K
End
If max(K={25,34:Then
">
real(6,0,40R-5,9+8Q,0
real(6,0,40R-6,9+8Q,0
End
Q+(K=34)-(K=25→Q
Q-2(Q=3)+2not(Q→Q
If max(K={24,26
">
real(6,0,40R-5,9+8Q,0
real(6,0,40R-6,9+8Q,0
R+(K=26)-(K=24)→R
R-2(R=3)+2not(R→R
End
If K=45 or R=2 and Q=2
Goto X
If R=1 and Q=1:Then
real(0,3,4,0
1→V:3→E:160→A:40→M:40→I:80→J
DelVar FDelVar HDelVar BDelVar Z
Repeat K=15
Z+1→Z
real(2,0→K
H+1→H:B+.5→B
If E≤0
.5→E
If K=2:Then
80→M:80→I:40→J
2→θ:2→W
End
If K=3:Then
80→I:40→J
3→θ:3→W
End
If K=4:Then
DelVar M
4→θ:4→W
End
real(7,9,0,M,I,J,5,0
If K=2
real(7,9,0,40,40,40,F
If K=3 or K=4
real(7,9,0,80,40,40,F
If B=E
A-40→A
real(7,9,A,0+80(C=2),40,80+40(C=3),D
If B≥E:Then
A+40→A
real(7,9,A,0+40(C=2),40,80+40(C=3),F
DelVar B
A-40→A
real(7,9,0,40,40,80,5,0
If θ=2
real(7,9,0,80,80,40,0,0
If θ=3
real(7,9,40,40,40,40,0,0
If θ=4
real(7,9,0,0,40,40,0,0
40→I:40→M:40→J
DelVar θ
End
If A=160
DelVar W
If C=3 and W≠3 and not(A:Then
15→K
1→V
End
If C=2 and W≠4 and not(A:Then
15→K
1→V
End
If C=1 and W≠2 and not(A:Then
15→K
1→V
End
If not(A:Then
real(7,9,A,0+40(C=2),40,80+40(C=3),F
E-.5→E
160→A
If H≥130:Then
randInt(0,255→F
DelVar θ
End
If H≥58
randInt(0,255→L
randInt(1,255→D
randInt(1,3→C
End
If F=D
randInt(0,255→D
End
If V=1:Then
real(0,3,4,0,0
"YOUR SCORE IS:
real(6,0,1,1,255,0
real(6,1,122,1,255,Z,0
If max(ʟNAG<Z:Then
Repeat K
real(2,0,0→K
"YOU GOT A HIGH SCORE!
real(6,0,1,9,R,0
randInt(1,255→R
End
{Z→ʟNAG
End
Repeat K
real(2,0,0→K
End
Repeat getKey
End
DelVar Z
1→G
End
If R=2 and Q=1:Then
real(0,3,4,0
"How to play:=Up arrow to jump=Down arrow to slide=Right arrow to SMASj`=The point of the=game is to get=through as many=obstacles as=possible,=traversing through=μltiple levels of=different=difficulties and=themes.
real(6,0,0,5,255,61
Repeat getKey
End
1→G
End
If R=1 and Q=2:Then
real(0,3,4,0,0
"This game was first=envisioned by alexgt=for The Codewalr.us=4x3 Contest. It     was=made for the HP=Prime, and now, the=TI-84+ CSE by=Unicorn.
real(6,0,0,5,255,61
Repeat getKey
End
1→G
End
If G
Goto H
Lbl X
real(0,1,1
real(0,3,4,255,1
real(0,3,4,255
Return

I've looked at the code, and it seems that this If condition doesn't have a corresponding End

Code:
If R=1 and Q=1:Then

You're missing an End command at the end of the playing part of the game, this makes it so that the info and and help options for which the code is placed after the actual game are in the same conditionals as the game itself, so clicking on them will skip right through the whole playing part (which includes the info and help options since there is a missing End) and end up at the end of the program. It's kind of like the whole program is one big mem leak xD I haven't tested this out, but I would try adding another End command at line 153 to put an end to the game part and allow the program to go through the rest of the program like this Smile

Code:
         {Z→ʟNAG
      End
      Repeat K
         real(2,0,0→K
      End
      Repeat getKey
      End
      DelVar Z
      1→G
   End:End

If this doesn't work, you might want to have a look at all the Ifs and loops in the playing part of the program, to make sure they all have their corresponding End Smile
I think that will be it. I had checked all of the If:Then's, but the game one. Big facepalm here.

Thanks a ton for helping me realize that. Smile

EDIT: Yup! That fixed it Very Happy
Just in case you missed it, this game is now done! Smile

You can download it from the archives, here: https://www.cemetech.net/programs/index.php?mode=file&path=/84pcse/basic/games/NagojiCSE.zip
  
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