Author Topic: RPG game bug  (Read 3959 times)

0 Members and 2 Guests are viewing this topic.

Offline sjasogun1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 88
  • Rating: +8/-1
    • View Profile
RPG game bug
« on: February 20, 2011, 08:43:06 am »
I am currently working on a small RPG game programmed in the language the fx-9860GII uses (some kind of BASIC, but not TI-BASIC), but there is a problem. I've got a first, primitive battle system working but there is a problem.
When the character dies in battle, the program functions normally; it returns to the Map-Routine and refills the characters HP and the next battle will start normally. But when the character wins in battle, the second battle only shows the attack animations of the character and the monster without even drawing the character or the monster, and then displays the character has won the battle again. The battle started after that works normally. I think this has something to do with using the return statement and then starting the program you returned from again, but I'm not sure. So here is the code for the routines ([DISP] means the DISP command):

RPGL1
Spoiler For RPGL1:
Code: [Select]
Lbl 0
ClrText
0->D
RanInt#(0,1)->R
Prog "RPGCHAR"
R=0=>Prog "RPGSLIME"
R=1=>Prog "RPGGIBTL"
Lbl 1
If Getkey=31
Then 1->G
Prog "RPGCHAR"
IfEnd
Locate 13,7,L
If L=0
Then ClrText
Locate 7,4,"YOU WON!"[DISP]
Return
IfEnd
G=1 And R=0=>Prog "RPGSLIME"
G=1 And R=1=>Prog "RPGGIBTL"
Locate 2,7,H
If H=0
Then ClrText
Locate 8,4,"YOU LOST"[DISP]
1->D
Return
IfEnd
Goto 1

RPGCHAR
Spoiler For RPGCHAR:
Code: [Select]
Lbl 2
G=0=>Goto 0
G=1=>Goto 1
Lbl 0
Locate 1,7,"H"
Locate 2,7,H
Locate 7,7,"M"
Locate 8,7,M
Locate 1,6,"---------------------"
Locate 3,3," o"
Locate 3,4,"-|-"
Locate 3,5,"/ \\"
Return
Goto 2
Lbl 1
7->X
For A+1->A To 17
Locate X,4,"@"
Locate X-1,4," "
Frac (A/2)=0=>6+A/2->X
Next
0->A
Locate 14,4," "
Locate 13,7,"    "
L>0=>L-RanInt#(2,6)*List 1[3]->L
L<0=>0->L
1->G
Return
Goto 2

RPGSLIME
Spoiler For RPGSLIME:
Code: [Select]
G=0=>Goto 0
G=1=>Goto 1
Lbl 0
40->L
0->P
Locate 12,7,"H"
Locate 13,7,L
Locate 18,7,"M"
Locate 19,7,P
Locate 7,1,"SLIME LV1"
Locate 15,2,"  ^"
Locate 15,3," / \\"
Locate 15,4,"/ o \\"
Locate 15,5,"\\___/"
Return
Lbl 1
13->X
For A+1->A To 17
Locate X,4,"@"
Locate X+1,4," "
Frac (A/2)=0=>14-A/2->X
Next
0->A
Locate 6,4," "
Locate 2,7,"    "
H>0=>H-RanInt#(2,6)x2->H
H<0=>0->H
0->G
Return

RPGGIBTL
Spoiler For RPGGIBTL:
Code: [Select]
G=0=>Goto 0
G=1=>Goto 1
Lbl 0
50->L
0->P
Locate 12,7,"H"
Locate 13,7,L
Locate 18,7,"M"
Locate 19,7,P
Locate 7,1,"GIANT BEETLE LV2"
Locate 15,3,"<---\\"
Locate 15,4,"|o  |"
Locate 15,5,"=-=-="
Return
Lbl 1
13->X
For A+1->A To 17
Locate X,4,"@"
Locate X+1,4," "
Frac (A/2)=0=>14-A/2->X
Next
0->A
Locate 6,4," "
Locate 2,7,"    "
H>0=>H-RanInt#(2,6)x3->H
H<0=>0->H
0->G
Return

RPGMAP1
Spoiler For RPGMAP1:
Code: [Select]
Lbl A
1->B
Locate 1,1,"******* ****** ******"
Locate 1,2,"******   ****  ******"
Locate 1,3,"*****   *10*   *****"
Locate 1,4,"***   3  ***     ***"
Locate 1,5,"**        *        *"
Locate 1,6,"      *       6    *"
Locate 1,7,"@    ***          **"
List 1[5]>=3=>Locate 7,4,"@"
List 1[5]>=6=>Locate 16,5,"@"
List 1[5]>=10=>Locate 11,3,"*@"
Lbl 0
If D=1
Then 0->D
List 1[1]->H
IfEnd
If B=1
Then Locate 1,6,"\/"
Locate 7,3," "
Locate 16,5," "
Locate 12,4,"*"
IfEnd
If B=2 And List 1[5]>=3
Then Locate 7,3,"\/"
Locate 1,6," "
Locate 16,5," "
Locate 12,4,"*"
IfEnd
If B=3 And List 1[5]>=6
Then Locate 16,5,"\/"
Locate 1,6," "
Locate 7,3," "
Locate 12,4,"*"
IfEnd
If B=4 And List 1[5]>=10
Then Locate 12,4,"^"
Locate 1,6," "
Locate 7,3," "
Locate 16,5,"*"
IfEnd
Getkey=27 And B=1 And List1[5]>=3=>B+1->B
Getkey=27 And B=2 And List1[5]>=6=>B+1->B
Getkey=27 And B=3 And List1[5]>=10=>B+1->B
Getkey=27 And B=4>=3=>B+1->B
Getkey=38 And B=1 And List 1[5]>=10=>B-1->B
Getkey=38 And B>2=>B-1->B
B>4=>1->B
B<1=>4->B
Getkey=31 And B=1=>Goto 1
Getkey=31 And B=2 And List1[5]>=3=>Goto 2
Getkey=31 And B=3 And List1[5]>=6=>Goto 3
Getkey=31 And B=4 And List1[5]>=10=>Goto 4
Getkey=78=>Goto 5
Goto 0
Lbl 1
Prog "RPGL1"
Goto A
Lbl 2
Prog "RPGL2"
Goto A
Lbl 3
Prog "RPGL3"
Goto A
Lbl 4
Prog "RPGB1"
Goto A
Lbl 5
Prog "RPGMENU"
D=1=>Return
Goto A

I have no idea what might have gone wrong, can anybody help?
« Last Edit: February 20, 2011, 08:43:21 am by sjasogun1 »
Veni, vidi, cecidi
(I came, I saw, I fell down dead)
MSPAFORUMS: http://www.mspaforums.com/
HOMESTUCK: http://www.mspaintadventures.com/?s=6&p=001901

Offline sjasogun1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 88
  • Rating: +8/-1
    • View Profile
Re: RPG game bug
« Reply #1 on: February 23, 2011, 04:16:13 am »
Never mind, I fixed it myself, I put RPGCHAR in RPGGIBTL and RPGSLIME, combining them. Now it works fine. Topic locked.
Veni, vidi, cecidi
(I came, I saw, I fell down dead)
MSPAFORUMS: http://www.mspaforums.com/
HOMESTUCK: http://www.mspaintadventures.com/?s=6&p=001901

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: RPG game bug
« Reply #2 on: February 23, 2011, 04:18:01 am »
Sorry I couldn't help D:. I guess it doesn't help that there aren't many Casio BASIC around yet. I myself should probably give BASIC a try again. Glad you got it fixed, though. Are you planning to eventually announce this project on the forums?

Offline sjasogun1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 88
  • Rating: +8/-1
    • View Profile
Re: RPG game bug
« Reply #3 on: February 23, 2011, 01:51:30 pm »
Yes, eventually I will, but it's still under development. When I finish the first, rough bit I'll make a topic and announce it. It's a bit like your Illusiat games, really; ASCII for the sprites and things like that. I'm sure it'll be good once I finish it, but right now it's still in the works. Making decent 5x3 sprites with just the characters on the Casio fx-9860GII and creating reasonable formula's are the hardest parts for now. I compensated having only 28 variables by using list data to store more info and to store the save data. I'll probably have some kind of alpha teaser version running in a week.
Veni, vidi, cecidi
(I came, I saw, I fell down dead)
MSPAFORUMS: http://www.mspaforums.com/
HOMESTUCK: http://www.mspaintadventures.com/?s=6&p=001901

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: RPG game bug
« Reply #4 on: February 23, 2011, 05:27:37 pm »
Cool, ASCII games can be nice too, if they're well used. I mean do not use R for the character sprite if he's called Riddick, for example. Use 8 or something like that, since it has something looking closer to an head and a body. Feel free to post about it in the projects section when you're ready.