the-isf-academy / quest

Wrapper over Python Arcade for first-year CS students making a top-down adventure game
0 stars 2 forks source link

Mouse-tracking UI #4

Closed cproctor closed 4 years ago

cproctor commented 4 years ago

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's change_x and change_y attributes on each update. The mixin would need to implement QuestGame.on_mouse_motion() (which it inherits from arcade.Window (docs) and keep track of the mouse's new coordinates whenever it moves.

wolfj95 commented 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.

cproctor commented 4 years ago

This was implemented in merge request #42. Great job!

AnnaC-coder commented 4 years ago

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.

hheeooll commented 4 years ago

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.