I want to make a game like http://www.onemorelevel.com/game/the_red_button for the TI calcs. I will be planning on using DCS to help program it, unfortunately I do not know DCS that well. Could someone please help me with this.

Some things I would like to do for this game are:

The very top (8 pixels maybe) I would like to make it kinda like DocDE6, except the big buttons for loading and saving. Instead I want it to have a button on the top right that when you click on it, it will make a small menu like DocDE6's about menu that will give you some options as to save, load, something slightly random (maybe scene selection).

I think I will be using 4 8*8 sprites for the button when they are big, and just one 8*8 sprite for the small buttons (like when they split into many buttons) maybe even 4*4 sprites (if I can do that, if not just make an 8*8 sprite with a small middle filled) for the "Mwahahah, now lets see you press it loser" part.

I want to make this as much like the original as I can.


Thats about all I can think of right now. I hope it made sense. Also, usually I am rather particular about you all giving code but I am fine with it for this one.
Ah, fun stuff. As far as I know, I'm the only person to really write code (aside from Kerm) with the DCS GUI. You can see that project here, for the gory details.
DCS uses a GUI stack to handle all that stuff- you push elements on which describe GUI elements (such as buttons or text), and the system will take care of rendering them, updating values, etc.

Here's a GUI 'Hello world!' as an example. It demonstrates the basic usage of the GUI system by creating a small window titled "Hello world!", containing the text "Hello, world!" and a button to close the program. I make no guarantees of this code actually working, and I'm omitting the file headers and such in the interest of brevity.

Code:
_9D95:
    call OpenGUIStack  ;initialize the GUI stack
    ld hl,wrapperWinData
    ld de,wrapperWinDataEnd-wrapperWinData
    ld a,GUIRSmallWin  ;Create a GUIRSmallWin described by wrapperWinData
    call pushGUIStack
    ld hl,helloWorldText
    ld de,helloWorldTextEnd-helloWorldText
    ld a,GUIRText
    call pushGUIStack  ;Insert the text
    ld hl,okButton
    ld de,okButtonEnd-okButton
    ld a,GUIRButtonText
    call pushGUIStack
    ld hl,0
    call GUIMouse  ;Render the GUI stack and go mouse

;This is the only way out of GUIMouse
EXIT:
    call ResetAppPage  ;don't ask questions, just do it
    call CloseGUIStack  ;cleans up the stack for us
    ret  ;exit

wrapperWinData:
  .db 15, 15           ;Coordinates-- (15,15) in this case
  .db %10101000  ;\
  .db %01010000  ; \
  .db %10101000  ;  | 5x5 icon
  .db %01010000  ; /
  .db %10101000  ;/
  .db "Hello world!",0  ;Title string
wrapperWinDataEnd
helloWorldText:
  .db 1,1  ;Coordinates - (1,1)
  .db 0  ;Font - always 0 for DCS6
  .db "Hello, world!",0
helloWorldTextEnd:
okButton:
  .db 1,10
  .dw EXIT  ;onclick handler
  .db "OK",0
okButtonEnd:

If you're doing any proper logic, you'll probably need some saferam. Be sure you pay attention to the memory areas used by the GUI system. For the complete list of GUI APIs and types, go have a look at the DCS wiki.

My own thoughts on the project: could be interesting, and you'll likely have to do some clever things in the interest of memory consumption, if you really do end up using the DCS GUI system. It might be easier to write your own special-purpose code for the game's UI, though..
  
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.

» Go to Registration page
Page 1 of 1
» 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

 

Advertisement