-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored code, added new Button class, reduced rerenders #25
Commits on Mar 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 5becdbe - Browse repository at this point
Copy the full SHA 5becdbeView commit details -
Refactored code to employ D.R.Y principles and reduce CPU consumption
created seperate functions for start and init to avoid rerendering the entire game screen every frame employed the usage of new Button class to reduce the hard coded functionalities for buttons in the main screen
Configuration menu - View commit details
-
Copy full SHA for d189280 - Browse repository at this point
Copy the full SHA d189280View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad46629 - Browse repository at this point
Copy the full SHA ad46629View commit details -
Refactored: Employed new Button class and made seperate functions for…
… starting and running to avoid rendering the ui every frame
Configuration menu - View commit details
-
Copy full SHA for 4d6dc05 - Browse repository at this point
Copy the full SHA 4d6dc05View commit details
Commits on Mar 30, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 01be221 - Browse repository at this point
Copy the full SHA 01be221View commit details
Commits on Mar 31, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 17bdd8b - Browse repository at this point
Copy the full SHA 17bdd8bView commit details
Commits on Apr 5, 2023
-
Made button act when released instead of when pressed
The button now has property press, which is turned true when button is pressed when button is released, the action is for the button is called
Configuration menu - View commit details
-
Copy full SHA for 30da576 - Browse repository at this point
Copy the full SHA 30da576View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e51d35 - Browse repository at this point
Copy the full SHA 2e51d35View commit details -
added not None check to score to avoid None type comparison
Sometimes the Score was none and was compared to int maxscore This would cause TypeError and cause game to crash
Configuration menu - View commit details
-
Copy full SHA for 31af7c4 - Browse repository at this point
Copy the full SHA 31af7c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f432cf - Browse repository at this point
Copy the full SHA 1f432cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for dbef2b8 - Browse repository at this point
Copy the full SHA dbef2b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 33fd5c7 - Browse repository at this point
Copy the full SHA 33fd5c7View commit details
Commits on Apr 10, 2023
-
- a was assigned in show_help and reassgined to self.running_mode - a has thus been eliminated - s has been renamed to score_data for more clarity of its purpose
Configuration menu - View commit details
-
Copy full SHA for 15fcc1f - Browse repository at this point
Copy the full SHA 15fcc1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d2f127 - Browse repository at this point
Copy the full SHA 1d2f127View commit details
Commits on Apr 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 861d2c9 - Browse repository at this point
Copy the full SHA 861d2c9View commit details
Commits on May 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 9a31892 - Browse repository at this point
Copy the full SHA 9a31892View commit details -
Deepen sugar3.activity.activity import
Sugargame TestActivity does import Activity, inherit, and initialise, so follow the same pattern This results in a blank grey display. Given that the only change is to imports, this suggests there is another problem that the unusual imports had hidden,
Configuration menu - View commit details
-
Copy full SHA for 825d3bd - Browse repository at this point
Copy the full SHA 825d3bdView commit details
Commits on May 30, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 926b14e - Browse repository at this point
Copy the full SHA 926b14eView commit details -
An update to Sugargame changed practice so that we use running as a flag instead of crashed.
Configuration menu - View commit details
-
Copy full SHA for 791fa67 - Browse repository at this point
Copy the full SHA 791fa67View commit details -
Configuration menu - View commit details
-
Copy full SHA for 49856c0 - Browse repository at this point
Copy the full SHA 49856c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for a862cf1 - Browse repository at this point
Copy the full SHA a862cf1View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc1a550 - Browse repository at this point
Copy the full SHA bc1a550View commit details -
Configuration menu - View commit details
-
Copy full SHA for 325a137 - Browse repository at this point
Copy the full SHA 325a137View commit details -
Configuration menu - View commit details
-
Copy full SHA for f06c7b0 - Browse repository at this point
Copy the full SHA f06c7b0View commit details -
Centered Screen and Restructured code
- Screen has been centered - vw and vh functions have been added to calculate relative co ords for screens - This allows support for multiple resolutions - restructured code wherever absolute values were used replaced them with new functions vw and vh - place_centered is added to blit things from their center as the origin instead of top left
Configuration menu - View commit details
-
Copy full SHA for bd6792f - Browse repository at this point
Copy the full SHA bd6792fView commit details
Commits on Jun 1, 2023
-
Configuration menu - View commit details
-
Copy full SHA for ec491e0 - Browse repository at this point
Copy the full SHA ec491e0View commit details -
Change object names for better understanding
- place_centered change to blit_centre - screen_origin change to offse - visible_size change to bg_dimensions
Configuration menu - View commit details
-
Copy full SHA for 43a9dfb - Browse repository at this point
Copy the full SHA 43a9dfbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 363793c - Browse repository at this point
Copy the full SHA 363793cView commit details
Commits on Jun 22, 2023
-
Create class Spike in spike.py
- This class acts as a generic spike and is used in Game to generate spikes as needed - The class contains logic to move the spike when updates
Configuration menu - View commit details
-
Copy full SHA for 28d3052 - Browse repository at this point
Copy the full SHA 28d3052View commit details -
Created generic Game and Generator class
- Game class can be used to create a game with any configuration - This can be used to replace the hardcoded games like 2panewindow, 3panewindow etc - The class constructor takes in the background_image the key map for the controller and optional speed and optional border_width - Generator class is used in Game class to generate the spikes in game as defined by spikes_config defined for each game - It also handles the logic to delete the spikes when they have covered their allocated path
Configuration menu - View commit details
-
Copy full SHA for ab0e7e8 - Browse repository at this point
Copy the full SHA ab0e7e8View commit details -
- the Guy class represents the falling guys which one may consider as the player characters - this class handles the logic for moving the guy left and right and also the collision checking
Configuration menu - View commit details
-
Copy full SHA for 863a12b - Browse repository at this point
Copy the full SHA 863a12bView commit details -
Updated main.py to use newer code structure
- main.py now uses the Game class to defined each game mode instead of hardcoded imports - modified the run_game function declaration and its calls according to newer methods - keymaps for each call are hardcoded and defined in the button callback lambda functions for each game mode button
Configuration menu - View commit details
-
Copy full SHA for e6f2771 - Browse repository at this point
Copy the full SHA e6f2771View commit details -
- now that Game class replaces the hard coded game modes in main.py these can be deleted
Configuration menu - View commit details
-
Copy full SHA for 830f254 - Browse repository at this point
Copy the full SHA 830f254View commit details -
Configuration menu - View commit details
-
Copy full SHA for 91f19ff - Browse repository at this point
Copy the full SHA 91f19ffView commit details -
Configuration menu - View commit details
-
Copy full SHA for c88e15b - Browse repository at this point
Copy the full SHA c88e15bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 95d47dd - Browse repository at this point
Copy the full SHA 95d47ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for f096254 - Browse repository at this point
Copy the full SHA f096254View commit details -
Declared BLACK and SPAWN_SPIKE_EVENT as constants
Also Deleted white as it was not being used
Configuration menu - View commit details
-
Copy full SHA for 5b117ff - Browse repository at this point
Copy the full SHA 5b117ffView commit details -
made keymap into list comprehension
and also moved it closer to function for better readability
Configuration menu - View commit details
-
Copy full SHA for 38346f0 - Browse repository at this point
Copy the full SHA 38346f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b36885 - Browse repository at this point
Copy the full SHA 9b36885View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea573b0 - Browse repository at this point
Copy the full SHA ea573b0View commit details -
- moved keymap iteration inside a conditional which checks for KEYDOWN events
Configuration menu - View commit details
-
Copy full SHA for 77ada49 - Browse repository at this point
Copy the full SHA 77ada49View commit details