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

A minor inconsistency in Window's methods' names; on_draw() vs update() #203

Closed
Mahi opened this Issue May 14, 2018 · 4 comments

Comments

2 participants
@Mahi

Mahi commented May 14, 2018

Sorry if this is intended, but to me it felt like an accidental inconsistency between similar methods; the arcade.application.Window class has some methods with the on_ prefix:

on_draw
on_mouse_visible
on_resize

But then there's the update() method that doesn't have the on_ prefix, even though it seems very similar to on_draw in my opinion.

@pvcraven

This comment has been minimized.

Owner

pvcraven commented May 15, 2018

Yes, this is true. Adding to that:

  • update() takes a delta time argument in the window class, but not the sprite class. The sprite class should.
  • Probably need to do something other than kill for sprites, as self.kill() isn't necessarily cool with some people.
  • There was something else this got me thinking of naming-related on the plane yesterday, but I can't remember it right now. Hopefully I will soon.

I think for backwards comparability we could just have both update and on_update work. The most work would be updating all the documentation to use the new name.

@Mahi

This comment has been minimized.

Mahi commented May 15, 2018

  • Yes, this allows game speed to be not tied to FPS. Definitely needed.
  • I don't see this being an issue really, but maybe something like destroy() could work a tiny bit better? Or release() or free() or something?
  • This is unlikely to be the same thing that was bothering you, but I've been trying to figure out if it's possible to get rid of the "globalness"; rather than doing window.draw_circle(...) or arcade.draw(window, ...) which would obviously draw on the window object, we use arcade.draw(...) and the current window object is stored in a global variable. This seems rather weak to me.

You mean keep the update() for backwards compatibility reasons? Or why have both?

pvcraven added a commit that referenced this issue May 18, 2018

@pvcraven pvcraven added this to In progress in Release 1.3.4 May 18, 2018

@pvcraven pvcraven moved this from In progress to Done in Release 1.3.4 May 18, 2018

@pvcraven

This comment has been minimized.

Owner

pvcraven commented May 18, 2018

I'll leave updating the examples to on_update for a later release.

@pvcraven pvcraven added this to the 1.3.4 milestone May 24, 2018

@pvcraven

This comment has been minimized.

Owner

pvcraven commented May 28, 2018

Closed with release of 1.3.4 on 28-May-2018.

@pvcraven pvcraven closed this May 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment