Thread: Shop questions
View Single Post
 
Reply
Posted 2004-06-02, 06:07 AM in reply to Fledge193's post "Shop questions"
Why not just use the default shop? That said, I don't know what the setup is going to be like (just one item on the screen at a time? Or a few?) and how big the items basically are.

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

With just one, it's a bit easier to set up. You just need to display the first picture at whatever coordinates you want, and capture the keys that the player is going to need - namely left, right, cancel, and enter. You then just change the one picture accordingly, based on whatever item you're on.

PSEUDOCODE:

<>Display picture of item (probably with price right on the picture)
<>Set variable [0055:ItemNumber] to 1
<>Start Loop
___<>Key input processing -> [0001:KeyCaptured]
___<>Comment: -----------------------------------------------
___<>Branch if Var [0001:KeyCaptured] is 2 (Left Key)
______<>ItemNumber = ItemNumber - 1
______<>
___:End
___<>Comment: -----------------------------------------------
___<>Branch if Var [0001:KeyCaptured] is 3 (Right Key)
______<>ItemNumber = ItemNumber + 1
______<>
___:End
___<>Comment: -----------------------------------------------
___<>Branch if Var [0001:KeyCaptured] is 5 (OK Key)
______<>Comment:------
______<>Comment: Buying Subroutine Goes Here
______<>Comment: Check for amount of gold, add +1 item based on
______<>Comment: ItemNumber variable, take away gold, then continue
______<>Comment: ------
___:End
___<>Comment: -----------------------------------------------
___<>Branch if Var [0001:KeyCaptured] is 6 (Cancel Key)
______<>Break out of loop
______<>
___:End
___<>Comment:-------The Part Below "wraps" the item list around-----
___<>Branch if Var [0055:ItemNumber] is 0
______<> ItemNumber = Maximum number of items
______<>
___:End
___<>Branch if Var [0055:ItemNumber] > Maximum Items
______<> ItemNumber = 1
______<>
___:End
___<>Comment:-----Picture changes happen here, add how many you need-----
___<>Comment:---Yes, picture will "change" even if you buy something instead---
___<>Comment ---of moving (of course, it will "change" to the same item thing)---
___<>Branch if ItemNumber = 1
______<>Change picture to "Potion"
______<>
___:End
___<>Branch if ItemNumber = 2
______<>Change picture to "Sword"
______<>
___:End
___<>Branch if ItemNumber = 3
______<>Change picture to "Shield"
______<>
___:End
___<>
:End (Loop)

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

I just threw that together. I'll have to do more when I get home..
Old
Profile PM WWW Search
BlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzBlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
BlueCube