Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dim pose$(15) : WindowWidth = 600 : WindowHeight = 900 : up = 1 : roam = 1
- loadbmp "left_left", "Pokemon Sprites\Player\left_leftfoot.bmp"
- loadbmp "left_right", "Pokemon Sprites\Player\left_rightfoot.bmp"
- loadbmp "left_stop", "Pokemon Sprites\Player\left_stop.bmp"
- loadbmp "right_left", "Pokemon Sprites\Player\right_leftfoot.bmp"
- loadbmp "right_right", "Pokemon Sprites\Player\right_rightfoot.bmp"
- loadbmp "right_stop", "Pokemon Sprites\Player\right_stop.bmp"
- loadbmp "forward_left", "Pokemon Sprites\Player\forward_leftfoot.bmp"
- loadbmp "forward_right", "Pokemon Sprites\Player\forward_rightfoot.bmp"
- loadbmp "forward_stop", "Pokemon Sprites\Player\forward_stop.bmp"
- loadbmp "backward_left", "Pokemon Sprites\Player\backward_leftfoot.bmp"
- loadbmp "backward_right", "Pokemon Sprites\Player\backward_rightfoot.bmp"
- loadbmp "backward_stop", "Pokemon Sprites\Player\backward_stop.bmp"
- open "Pokemon Player Walk" for graphics_nf_nsb as #pwalk
- #pwalk, "trapclose [exit]" : #pwalk, "when characterInput [keypress]" : #pwalk, "setfocus"
- #pwalk, "addsprite left_left left_left" : #pwalk, "addsprite forward_left forward_left"
- #pwalk, "addsprite left_right left_right" : #pwalk, "addsprite forward_right forward_right"
- #pwalk, "addsprite left_stop left_stop" : #pwalk, "addsprite forward_stop forward_stop"
- #pwalk, "addsprite right_left right_left" : #pwalk, "addsprite backward_left backward_left"
- #pwalk, "addsprite right_right right_right" : #pwalk, "addsprite backward_right backward_right"
- #pwalk, "addsprite right_stop right_stop" : #pwalk, "addsprite backward_stop backward_stop"
- #pwalk, "spritescale left_left 150" : #pwalk, "spritescale forward_left 150"
- #pwalk, "spritescale left_right 150" : #pwalk, "spritescale forward_right 150"
- #pwalk, "spritescale left_stop 150" : #pwalk, "spritescale forward_stop 150"
- #pwalk, "spritescale right_left 150" : #pwalk, "spritescale backward_left 150"
- #pwalk, "spritescale right_right 150" : #pwalk, "spritescale backward_right 150"
- #pwalk, "spritescale right_stop 150" : #pwalk, "spritescale backward_stop 150"
- #pwalk, "spritevisible left_left off" : #pwalk, "spritevisible forward_left off"
- #pwalk, "spritevisible left_right off" : #pwalk, "spritevisible forward_right off"
- #pwalk, "spritevisible left_stop off" : #pwalk, "spritevisible forward_stop off"
- #pwalk, "spritevisible right_left off" : #pwalk, "spritevisible backward_left off"
- #pwalk, "spritevisible right_right off" : #pwalk, "spritevisible backward_right off"
- #pwalk, "spritevisible right_stop off" : #pwalk, "spritevisible backward_stop off"
- timer 100, [move]
- wait
- 'the above code sets up all the player sprites for use
- 'loading them, scaling them, and hiding them.
- 'the following code manages keypresses, which will be configurable in the future
- [keypress]
- #pwalk, "\";Inkey$
- select case Inkey$
- case chr$(13) : goto [pSTART] 'enter
- case "e" : goto [pA]
- case "E" : goto [pA]
- case chr$(32) : goto [pB] 'space
- case "w" : goto [pUP]
- case "W" : goto [pUP]
- case "s" : goto [pDOWN]
- case "S" : goto [pDOWN]
- case "a" : goto [pLEFT]
- case "A" : goto [pLEFT]
- case "d" : goto [pRIGHT]
- case "D" : goto [pRIGHT]
- case chr$(8) : goto [pSELECT] 'backspace
- case else : wait
- end select : wait
- 'the next few bits look at factors in game, and tell the program
- 'where to go from here, if reading the dex it makes the buttons conform to
- 'those commands, if in battle, roaming the world, or in a menu/shop
- [pSTART]
- if start = 1 then goto [startgame_menu]
- if menuopen = 1 then goto [menuclose]
- if conver = 1 then goto [nothing]
- if dexread = 1 then goto [nothing]
- if shop = 1 then goto [nothing]
- if shopbuy = 1 then goto [nothing]
- if battle = 1 then goto [nothing]
- if dexuse = 1 then goto [dexsearch]
- if roam = 1 then goto [menuopen]
- open "pkmn_error.txt" for append as #1
- print #1, time$("ms");": unhandled start press"
- close #1
- wait
- [pA]
- if start = 1 then goto [startgame_menu]
- if menuopen = 1 then goto [menu_a]
- if conver = 1 then goto [conver_a]
- if dexread = 1 then goto [nextpage_dexread]
- if shop = 1 then goto [buy]
- if shopbuy = 1 then goto [buyfinal]
- if battle = 1 then goto [battle_a]
- if dexuse = 1 then goto [dex_a]
- if roam = 1 then goto [itemup]
- open "pkmn_error.txt" for append as #1
- print #1, time$("ms");": unhandled a press"
- close #1
- wait
- [pB]
- if start = 1 then goto [nothing]
- if menuopen = 1 then goto [menu_b]
- if conver = 1 then goto [conver_b]
- if dexread = 1 then goto [dexback]
- if shop = 1 then goto [shopback]
- if shopbuy = 1 then goto [shopbackfinal]
- if battle = 1 then goto [battle_a]
- if dexuse = 1 then goto [dex_b]
- if roam = 1 then goto [nothing]
- open "pkmn_error.txt" for append as #1
- print #1, time$("ms");": unhandled b press"
- close #1
- wait
- [pUP]
- if start = 1 then goto [nothing]
- if menuopen = 1 then goto [menu_up]
- if conver = 1 then goto [nothing]
- if dexread = 1 then goto [dexpageup]
- if shop = 1 then goto [shop_up]
- if shopbuy = 1 then goto [nothing]
- if battle = 1 then goto [battle_up]
- if dexuse = 1 then goto [dex_up]
- if roam = 1 then moveflag = 1 : wait
- open "pkmn_error.txt" for append as #1
- print #1, time$("ms");": unhandled up press"
- close #1
- wait
- [pDOWN]
- if start = 1 then goto [nothing]
- if menuopen = 1 then goto [menu_down]
- if conver = 1 then goto [nothing]
- if dexread = 1 then goto [dexpagedown]
- if shop = 1 then goto [shop_down]
- if shopbuy = 1 then goto [nothing]
- if battle = 1 then goto [battle_down]
- if dexuse = 1 then goto [dex_down]
- if roam = 1 then moveflag = 2 : wait
- open "pkmn_error.txt" for append as #1
- print #1, time$("ms");": unhandled down press"
- close #1
- wait
- [pLEFT]
- if start = 1 then goto [nothing]
- if menuopen = 1 then goto [nothing]
- if conver = 1 then goto [nothing]
- if dexread = 1 then goto [nothing]
- if shop = 1 then goto [nothing]
- if shopbuy = 1 then goto [buy_dec]
- if battle = 1 then goto [battle_left]
- if dexuse = 1 then goto [nothing]
- if roam = 1 then moveflag = 3 : wait
- open "pkmn_error.txt" for append as #1
- print #1, time$("ms");": unhandled left press"
- close #1
- wait
- [pRIGHT]
- if start = 1 then goto [nothing]
- if menuopen = 1 then goto [nothing]
- if conver = 1 then goto [nothing]
- if dexread = 1 then goto [nothing]
- if shop = 1 then goto [nothing]
- if shopbuy = 1 then goto [buy_inc]
- if battle = 1 then goto [battle_right]
- if dexuse = 1 then goto [nothing]
- if roam = 1 then moveflag = 4 : wait
- open "pkmn_error.txt" for append as #1
- print #1, time$("ms");": unhandled right press"
- close #1
- wait
- 'the program uses a simple uncontrolled keypress system, so if I'm missing something, it'll write to file
- [nothing]
- wait
- [move]
- if moveflag = 0 then wait
- if moveflag = 1 then
- if lastmove = 1 then #pwalk, "spritexy? forward_stop x y"
- if lastmove = 2 then #pwalk, "spritexy? backward_stop x y"
- if lastmove = 3 then #pwalk, "spritexy? left_stop x y"
- if lastmove = 4 then #pwalk, "spritexy? right_stop x y"
- #pwalk, "spritevisible backward_stop off"
- #pwalk, "spritevisible left_stop off"
- #pwalk, "spritevisible right_stop off"
- #pwalk, "spritexy forward_left ";x;" ";y-(9)
- #pwalk, "spritexy forward_right ";x;" ";y-(18)
- #pwalk, "spritexy forward_stop ";x;" ";y-(28)
- time = time$("ms")
- [up_left4]
- time2 = time$("ms")
- if time2-time < 80 then goto [up_left4]
- #pwalk, "spritevisible forward_stop off"
- #pwalk, "spritevisible forward_left on"
- #pwalk, "drawsprites"
- time = time$("ms")
- [up_right4]
- time2 = time$("ms")
- if time2-time < 80 then goto [up_right4]
- #pwalk, "spritevisible forward_left off"
- #pwalk, "spritevisible forward_right on"
- #pwalk, "drawsprites"
- time = time$("ms")
- [up_stop4]
- time2 = time$("ms")
- if time2-time < 80 then goto [up_stop4]
- #pwalk, "spritevisible forward_right off"
- #pwalk, "spritevisible forward_stop on"
- #pwalk, "drawsprites"
- moveflag = 0 : lastmove = 1
- wait
- end if
- if moveflag = 2 then
- if lastmove = 1 then #pwalk, "spritexy? forward_stop x y"
- if lastmove = 2 then #pwalk, "spritexy? backward_stop x y"
- if lastmove = 3 then #pwalk, "spritexy? left_stop x y"
- if lastmove = 4 then #pwalk, "spritexy? right_stop x y"
- #pwalk, "spritevisible left_stop off"
- #pwalk, "spritevisible forward_stop off"
- #pwalk, "spritevisible right_stop off"
- #pwalk, "spritexy backward_left ";x;" ";y+9
- #pwalk, "spritexy backward_right ";x;" ";y+18
- #pwalk, "spritexy backward_stop ";x;" ";y+28
- time = time$("ms")
- [uptimer_left4]
- time2 = time$("ms")
- if time2-time < 80 then goto [uptimer_left4]
- #pwalk, "spritevisible backward_stop off"
- #pwalk, "spritevisible backward_left on"
- #pwalk, "drawsprites"
- time = time$("ms")
- [uptimer_right4]
- time2 = time$("ms")
- if time2-time < 80 then goto [uptimer_right4]
- #pwalk, "spritevisible backward_left off"
- #pwalk, "spritevisible backward_right on"
- #pwalk, "drawsprites"
- time = time$("ms")
- [uptimer_stop4]
- time2 = time$("ms")
- if time2-time < 80 then goto [uptimer_stop4]
- #pwalk, "spritevisible backward_right off"
- #pwalk, "spritevisible backward_stop on"
- #pwalk, "drawsprites"
- moveflag = 0 : lastmove = 2
- wait
- end if
- if moveflag = 4 then
- if lastmove = 1 then #pwalk, "spritexy? forward_stop x y"
- if lastmove = 2 then #pwalk, "spritexy? backward_stop x y"
- if lastmove = 3 then #pwalk, "spritexy? left_stop x y"
- if lastmove = 4 then #pwalk, "spritexy? right_stop x y"
- #pwalk, "spritevisible forward_stop off"
- #pwalk, "spritevisible backward_stop off"
- #pwalk, "spritevisible left_stop off"
- #pwalk, "spritexy right_left ";x+8;" ";y
- #pwalk, "spritexy right_right ";x+16;" ";y
- #pwalk, "spritexy right_stop ";x+25;" ";y
- time = time$("ms")
- [right_left4]
- time2 = time$("ms")
- if time2-time < 80 then goto [right_left4]
- #pwalk, "spritevisible right_stop off"
- #pwalk, "spritevisible right_left on"
- #pwalk, "drawsprites"
- time = time$("ms")
- [right_right4]
- time2 = time$("ms")
- if time2-time < 80 then goto [right_right4]
- #pwalk, "spritevisible right_left off"
- #pwalk, "spritevisible right_right on"
- #pwalk, "drawsprites"
- time = time$("ms")
- [right_stop4]
- time2 = time$("ms")
- if time2-time < 80 then goto [right_stop4]
- #pwalk, "spritevisible right_right off"
- #pwalk, "spritevisible right_stop on"
- #pwalk, "drawsprites"
- moveflag = 0 : lastmove = 4
- wait
- end if
- if moveflag = 3 then
- if lastmove = 1 then #pwalk, "spritexy? forward_stop x y"
- if lastmove = 2 then #pwalk, "spritexy? backward_stop x y"
- if lastmove = 3 then #pwalk, "spritexy? left_stop x y"
- if lastmove = 4 then #pwalk, "spritexy? right_stop x y"
- #pwalk, "spritevisible forward_stop off"
- #pwalk, "spritevisible backward_stop off"
- #pwalk, "spritevisible right_stop off"
- #pwalk, "spritexy left_left ";x-(8);" ";y
- #pwalk, "spritexy left_right ";x-(16);" ";y
- #pwalk, "spritexy left_stop ";x-(25);" ";y
- time = time$("ms")
- [left_left4]
- time2 = time$("ms")
- if time2-time < 80 then goto [left_left4]
- #pwalk, "spritevisible left_stop off"
- #pwalk, "spritevisible left_left on"
- #pwalk, "drawsprites"
- time = time$("ms")
- [left_right4]
- time2 = time$("ms")
- if time2-time < 80 then goto [left_right4]
- #pwalk, "spritevisible left_left off"
- #pwalk, "spritevisible left_right on"
- #pwalk, "drawsprites"
- time = time$("ms")
- [left_stop4]
- time2 = time$("ms")
- if time2-time < 80 then goto [left_stop4]
- #pwalk, "spritevisible left_right off"
- #pwalk, "spritevisible left_stop on"
- #pwalk, "drawsprites"
- moveflag = 0 : lastmove = 3
- wait
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement