Skip to content
Advertisement

Why is the class attribute changing only once?

JavaScript

Battlefield.field is dictionary with keys:

JavaScript

I know that this is far from the best solution, but to work with this, I decided to write a cursor class:

JavaScript

My problem: When I try to move a cursor multiple times by using the “up” function and others, the self.point value changes only once.

JavaScript

The last use a function should return “1d”. I dont know what to do..

Advertisement

Answer

You’re only updating self.point, not self.point_key_idx.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement