User Tools

Site Tools


notes:discrete:fall2021:projects:mpg0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:discrete:fall2021:projects:mpg0 [2021/11/04 04:30] – Fixed up page header formatting smalik3notes: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 'TIC()' function as that may cause clutter and confusion.
  
 ====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 "character." If you wanted to start your sprite at (0,0), then the X and Y values would be 0, respectively. Keep in mind that the base sprite is 8x8 pixels, and these coordinates are also in pixels. So, if your map layer had a special spot on its 3rd sprite from the left and 1st from the top where your character starts the game, you would have to draw the sprite at (24,8) and not (3,1). You can also code it as (3*8,1*8) so it is easier to adjust the coordinate(s) without having to worry about the constant sprite dimension of 8. This can be adjusted to (x*8,y*8) for even greater ease.
  
 ====Controls (mouse)==== ====Controls (mouse)====
Line 60: Line 64:
  
 https://github.com/nesbox/TIC-80/wiki https://github.com/nesbox/TIC-80/wiki
 +
 +https://github.com/nesbox/TIC-80/wiki/Simple-Platformer-tutorial
  
 https://www.lua.org/pil/contents.html https://www.lua.org/pil/contents.html
notes/discrete/fall2021/projects/mpg0.1636000232.txt.gz · Last modified: 2021/11/04 04:30 by smalik3