Closed cproctor closed 4 years ago
@the-isf-academy/mario, you can start by reading through the docs Chris linked to see what mouse-related functions are available. Then, try creating a new child class that extends the arcade.Window parent class and implementing one of the mouse-related functions.
This was implemented in merge request #42. Great job!
I think our discussions went pretty well. Something that I found different was that it would be so vague and hard to start off with writing our code. I think in other projects, we should do more discussion and planning before writing our code and also do some pseudo codes.
What went well? In this lab, I think we did well on using different ways to solve the issue, as we have different types of method to organize our ideas. For example drawings and pseudo-code. What was different than you expected? I thought it will be quite easy to start writing the code for mouse tracking, but it was really hard... what will you differently in other projects? For the game project, I think I should work faster as we didn't finish coding for this quest lab.
Currently, the player is controlled using the keyboard's arrow keys. In some games, it might be better if the player were controlled using the mouse. The player would always try to move toward the cursor.
To enable this, I propose a MouseTrackerUI mixin to
QuestGame
which would set the player'schange_x
andchange_y
attributes on each update. The mixin would need to implementQuestGame.on_mouse_motion()
(which it inherits fromarcade.Window
(docs) and keep track of the mouse's new coordinates whenever it moves.