This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:discrete:fall2021:projects:mpg0 [2021/11/04 04:30] – Fixed up page header formatting smalik3 | notes:discrete:fall2021:projects:mpg0 [2021/11/11 06:23] (current) – Added information about game ticks and screens smalik3 | ||
---|---|---|---|
Line 38: | Line 38: | ||
As is common practice, your game may require the use of multiple screens. That is, you may want to include a title screen, death screen, and other such differing states of the game. Especially in the weeks of saf# and pnf#, it became quite apparent that the ability to present the user with varying screens was useful in order to convey relevant information as well as provide relevant functionality at different stages in the execution of our programs. This has led to the development in several examples of what may be called **stateful programs** where a variable is reserved in order to keep track of what screen should be displayed. By referencing that variable using some form of a switch statement, more organized functionality is achieved by compartmentalizing each individual screen to its own logical corner. | As is common practice, your game may require the use of multiple screens. That is, you may want to include a title screen, death screen, and other such differing states of the game. Especially in the weeks of saf# and pnf#, it became quite apparent that the ability to present the user with varying screens was useful in order to convey relevant information as well as provide relevant functionality at different stages in the execution of our programs. This has led to the development in several examples of what may be called **stateful programs** where a variable is reserved in order to keep track of what screen should be displayed. By referencing that variable using some form of a switch statement, more organized functionality is achieved by compartmentalizing each individual screen to its own logical corner. | ||
+ | |||
+ | It is important to keep in mind how game ticks affect your ability to display different screens, what screens should be given priority? Should my screens have their own separate functions? these are important questions to ask yourself as you implement these things. It would not be wise to implement too much inside of your ' | ||
====Controls (controller)==== | ====Controls (controller)==== | ||
Line 46: | Line 48: | ||
The key mapping system allows for keyboard controls as well as gamepad controls to be merged as the inputs are mapped to a set of constant values. This allows we as developers to develop for both keyboard and gamepad users simultaneously without much additional consideration except for ergonomics. | The key mapping system allows for keyboard controls as well as gamepad controls to be merged as the inputs are mapped to a set of constant values. This allows we as developers to develop for both keyboard and gamepad users simultaneously without much additional consideration except for ergonomics. | ||
+ | |||
+ | For said constant values, the bare minimum would be the x and y coordinates of the player " | ||
====Controls (mouse)==== | ====Controls (mouse)==== | ||
Line 60: | Line 64: | ||
https:// | https:// | ||
+ | |||
+ | https:// | ||
https:// | https:// |