DEV Community

Siver.T
Siver.T

Posted on Originally published at ja2-3d.blogspot.com on

Finaly some screenshots

So, today I will post more screenshots as usual :) I have started with implementation of the screen management. I have also implemented some screens as init screen, main menu screen and laptop screen.

Class diagram
GameScreen is used as a base class for all screen implementations. When new screen implementation is to be created, get_next_screen(), init(), suspend() and update() methods must be implemented. init() operation is used when screen is to be initialized. It is right after it is selected as active screen (active screen is screen that is actually shown and user interact with it). init() operation can be called more than once but never less (For instance, laptop screen can be shown many times, and always before it state change from "inactive" to "active", init() funciton is called). Before screen state will be changed to "inactive", suspend() operation will be called. update() operation is called in loop. It is used for rendering the screen and also handle input and so. update() operation can return one of this values:

  • SA_NOOP - is used when screen should stay active.
  • SA_SHOW_PARENT - is used when parent screen (Screen that has created actual screen) should be shown as next screen.
  • SA_SHOW_NEXT - is used when screen returned from get_next_screen() should be shown as next screen. Current screen WILL BE saved as parent screen to screen stack.
  • SA_SHOW_NEXT_WITHOUT_PARENT - is used as SA_SHOW_NEXT but actual screen WILL BE NOT saved as parent screen (it is used for screen that should be shown only once in game). Screen stack is container of all parent screens. It is represented as stack.

Init screen

Init screen is responsible for showing some "pre-game" credits as logo and also for pre-loading some game stuff. For now only logo is showed, no preloading.

Init screen

Intro screen

Intro screen is used for some game intros. I haven't used it for now, but in future probably will.

Main menu screen

As the title says, this screen is responsible for handling the main menu. So when user click on the new game button, new game screen should be created and responsibility should be moved there. For now only "new game" and "quit" choices are "active".

Main menu screen

Laptop screen

Laptop screen represent the laptop. User can browse the web here, read the mails or browse some local files. Not much is working one. To be honest, only some texures are shown:)

Top comments (0)