-
Notifications
You must be signed in to change notification settings - Fork 8
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
Reimplement logic of coin capture #3
Comments
I took a look at the code and I have an idea. Currently coins are created and put into a list. I want to add an additional layer to this by creating a nested dictionary which uses the coin coordinates as keys and stores the coin index in the resulting nest structure (so something like `{"x coordinate"{"y coordinate" = coin index}}). Then instead of checking every coin the dictionary is referenced to check if a coin exists. If it does the coin list is accessed to update the coin's state. If this sounds like a viable implementation I'll work on it. |
Nice idea and seems viable you may get going with it |
@jrkong status? |
Currently debugging. I'm thinking that just using the x and y isn't viable because of a few issues:
Right now I'm testing moving the coin logic into the board update logic so it removes the coin at the updated location if Mario passes it using the coin dictionary I implemented. |
Nice |
Right now for seeing a capture of coin the function iterates over all set coins and checks whether some matches with Mario or not. This is highly ineffective and needs to be changed.
The text was updated successfully, but these errors were encountered: