What should be in the shop?
Characters with pre determined stats  22%  [ 2 ]
Guns and swords for the one character  77%  [ 7 ]

I just started getting back into coding games, but I am tending to finish 3/4 of one and quit. I just started making this one at school today wanting to make it like a street fighter game that I saw.

Currently, I have made the fight area, the fighters, and they are able to duke it out and kill each other. Currently, you can move your avatar left and right, as well as shoot a gun for ranged attack and jab with a sword for melee. While I like what I have done so far, the way that I coded it makes the actions move very slow compared to when all I had was a pi symbol that could move left and right.
Currently, I have two ideas. One is that I put a bunch of goto commands after each action so that I can skip over stuff. The problem with this of course is memory loss. My second idea is that I could move all of the if statements inside the Repeat section and just have Goto's to out of it.

Other than that, all I have is deciding a currency system for winning and adding stuff to the shop section. Any opinions are greatly appreciated!

Code:
```Lbl M 1→A ClrHome Output(1,7,"STREET FIGHTER Output(3,2,"BEGIN GAME Output(4,2,"CHARACTER SHOP Output(3,1,"> Output(5,2,"HIGHSCORES Output(6,2,"INSTRUCTIONS Output(7,2,"CREDITS Output(8,2,"QUIT Lbl N Repeat K≠0 getKey→K End If K=25 A-1→A If K=34 A+1→A If A>6 6→A If A<1 1→A Output(A+2,1,"> Output(A+1,1," Output(A+3,1," If K≠105 Goto N For(B,1,25 Output(A+2,B," > End ClrHome If A=5 Goto C If A=6 Goto Q If A=2 Goto CH If A=3 Goto H If A=1 Goto A Disp "CONTROLS: Disp "2ND-SWORD Disp "ALPHA-GUN Pause "ARROWS-MOVE PLAYER Goto M Lbl Q ClrHome Return Lbl C Disp " Output(1,10,"CREDITS! Output(2,2,"THIS PROGRAM WAS MADE BY ALPHA527. Pause Goto M Lbl CH Pause "COMING SOON Goto M Lbl H Pause "COOMING SOON Goto M Lbl A Output(10,1,"-------------------------- Output(1,1,"HP: Output(1,21,"HP: 8→⌊POS(1 9→⌊POS(2 22→⌊POS(3 ⌊HP(1→D ⌊HP(2→E Output(9,8,"π Output(9,22,"≥ Lbl PR randInt(1,5,1)→A ⌊A(1→P Output(1,5,"  Output(1,25,"  Output(1,4,D Output(1,24,E For(A,1,9999 getKey→K If K≠0 10000→A End If K=24 ⌊POS(1)-1→⌊POS(1 If K=26 ⌊POS(1)+1→⌊POS(1 If K=25 ⌊POS(2)-1→⌊POS(2 If K=21 Then Output(⌊POS(2),⌊POS(1)+1,"­ For(A,1,50 End End If K=21 and ⌊POS(3)-1=⌊POS(1) E-⌊ATT(1→E If K=31 Then For(A,⌊POS(1)+2,⌊POS(3)-1 Output(9,A," • End E-⌊ATT(2→E Output(9,25,"  End If P=5 Then For(A,⌊POS(3)-1,⌊POS(1),­1 Output(9,A,"• End D-⌊ATT(4)→D Output(9,1,"  End If P=1 ⌊POS(3)-1→⌊POS(3 If P=2 ⌊POS(3)+1→⌊POS(3 If ⌊POS(3)>26 25→⌊POS(3 If ⌊POS(3)<1 2→⌊POS(3 If P=3 or 4=P Then Output(9,⌊POS(3)-1,"­ For(A,1,50 End If ⌊POS(1)=⌊POS(3)-1 D-⌊ATT(3→D Output(9,⌊POS(3)-1," End Output(⌊POS(2),⌊POS(1),"π If K=24 or K=21 Output(⌊POS(2),⌊POS(1)+1," Output(9,⌊POS(3),"≥ If P=1 Output(9,⌊POS(3)+1," If P=2 Output(9,⌊POS(3)-1," If K=26 Output(⌊POS(2),⌊POS(1)-1," If D≤0 or E≤0 Goto EN Goto PR Lbl EN ClrHome If E≤0 Output(5,10,"YOU WIN! If D≤0 Output(5,10,"YOU LOSE Pause Return```
This looks like it would be pretty neat! I just have a few simple optimizations

First, you can chain together 'Disp ' commands and get the same result. This just saves space.

Code:
```Disp "CONTROLS: Disp "2ND-SWORD Disp "ALPHA-GUN ```

Could be

Code:
`Disp "CONTROLS:","2ND-SWORD","ALPHA-GUN"`

***TheLastMillennial gets slapped
Listen to PT_ on this one
Another:

Code:
```For(A,1,9999 [code here] 10000→A```

If I'm following your code correctly, you may as well do

Code:
``` While 1 [code here]```

While 1 just makes an infinite loop that wont end until it encounters a Stop, Return, or if a goto jumps out of the loop. This saves you some space, and is more efficient.

A more complicated optimization for your arrow key entry.

Code:
```If K=25 A-1→A If K=34 A+1→A If A>6 6→A If A<1 1→A ```

I'm pretty sure could be

Code:
`max(6,min(1,A+sum(ΔList(K={25,34→A`

This

Code:
```If K=24 ⌊POS(1)-1→⌊POS(1 If K=26 ⌊POS(1)+1→⌊POS(1```

I think this would work

Code:
`⌊POS(1)+sum(ΔList(K={24,26→⌊POS(1)`

Good luck completing this project!
TheLastMillennial wrote:

Code:
```For(A,1,9999 [code here] 10000→A```

If I'm following your code correctly, you may as well do

Code:
``` While 1 [code here]```

While 1 just makes an infinite loop that wont end until it encounters a Stop, Return, or if a goto jumps out of the loop. This saves you some space, and is more efficient.

***PT_ slaps TheLastMillennial
These codes are definitely not the same I guess his For loop is just to loop many many times until it a key is hit, which should be the same as "Repeat K". Also, don't use a Goto in a For, While or Repeat loop . Also it seems that variable A is always being overwritten in the For loop, so it might indeed be an infinite loop (not sure of though).
TheLastMillennial wrote:
This looks like it would be pretty neat! I just have a few simple optimizations

First, you can chain together 'Disp ' commands and get the same result. This just saves space.

Code:
```Disp "CONTROLS: Disp "2ND-SWORD Disp "ALPHA-GUN ```

Could be

Code:
`Disp "CONTROLS:","2ND-SWORD","ALPHA-GUN"`

***TheLastMillennial gets slapped
Listen to PT_ on this one
Another:

Code:
```For(A,1,9999 [code here] 10000→A```

If I'm following your code correctly, you may as well do

Code:
``` While 1 [code here]```

While 1 just makes an infinite loop that wont end until it encounters a Stop, Return, or if a goto jumps out of the loop. This saves you some space, and is more efficient.

A more complicated optimization for your arrow key entry.

Code:
```If K=25 A-1→A If K=34 A+1→A If A>6 6→A If A<1 1→A ```

I'm pretty sure could be

Code:
`max(6,min(1,A+sum(ΔList(K={25,34→A`

This

Code:
```If K=24 ⌊POS(1)-1→⌊POS(1 If K=26 ⌊POS(1)+1→⌊POS(1```

I think this would work

Code:
`⌊POS(1)+sum(ΔList(K={24,26→⌊POS(1)`

Good luck completing this project!

Thanks for the help!

However, your optimization for the arrow keys sadly didn't work (at least for me).

While the last optimization did work, it slowed the game down significantly so I don't think that it's worth the extra bytes saved.

So far, I haven't made any progress, but I hopefully will tomorrow!

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.

»
» 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