? Battle system. (RPG Style) (Page 2) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Battle system. (RPG Style)

1 2
  • #21 ✎ 33 Plancake Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Reading I like to read books! Hobbies Try this: 'I don't know what type of game you're making, so I'm using an RPG as an example CLS DIM EN$[3,3] 'You can only have string (text) or integer (number) arrays, not a combination of both RESTORE @EDATA FOR J =0 TO 2 FOR I=0 TO 2 READ EN$[I,J] NEXT NEXT MYHP=100 MYPOW=4 PRINT EN$[0,0]+", "+EN$[1,0]+" and "+EN$[2,0]+" are ready to fight!" 'Enemy names PRINT "HP:"+EN$[0,1]+" HP:"+EN$[1,1]+" HP:"+EN$[2,1] PRINT "My HP:" + STR$(MYHP) WAIT 150 PRINT "You attack "+EN$[2,0]+" for "+STR$(MYPOW)+" damage!" 'Enemy 3 EN$[2,1]=STR$(VAL(EN$[2,1])-1) WAIT 150 PRINT EN$[0,0]+", "+EN$[1,0]+" and "+EN$[2,0]+" are ready to fight!" PRINT "HP:"+EN$[0,1]+" HP:"+EN$[1,1]+" HP:"+EN$[2,1] PRINT "My HP:" + STR$(MYHP) PRINT EN$[1,0]+" attacks you for "+EN$[1,2]+" damage" 'Enemy 2's attack power MYHP=MYHP-VAL(EN$[1,2]) WAIT 150 PRINT EN$[0,0]+", "+EN$[1,0]+" and "+EN$[2,0]+" are ready to fight!" PRINT "HP:"+EN$[0,1]+" HP:"+EN$[1,1]+" HP:"+EN$[2,1] PRINT "My HP:" + STR$(MYHP) WHILE TRUE WEND @LEVEL1ENEMYDATA 'You can make multiple data labels for different levels and use RESTORE to get this data, then use READ (shown above) to store it into an array DATA "Goblin","30","5" DATA "Beast","40","7" DATA "Snake","15","5" Also can't test this code, but don't worry if you can't understand it, I'll be here to help whenever I can. :) Posted
  • #22 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Thanks to every one who helped. I have a working system. Its simple but it works. You guys opened my mind to arrays and it helped a lot. Thank you. Elaysia would have been put on Hiatus if not for your help. Thanks so much. Hope you guys play it when it comes out! Posted
  • #23 ✎ 33 Plancake Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Reading I like to read books! Hobbies You're welcome! If you ever need help again, just ask, we may be a small community, but we try to help each other whenever we can. I'd love to see what you can make with SmileBASIC! Posted
1 2