sugarlabs / flappy-birds-activity

An arcade game for Sugar XOs.
1 stars 13 forks source link

Add parallax effect. #27

Closed sparshg closed 2 years ago

sparshg commented 2 years ago

@chimosky @srevinsaju Please review, I splitted the background into different images and moved them with different speeds to make parallax effect.

chimosky commented 2 years ago

Reviewed, not tested. Thanks!

sparshg commented 2 years ago

I added more comments and broke more of hardcoded values into well defined variables. Also splitted the self.background list logic into more readable code.

chimosky commented 2 years ago

Tested and I get this error;

Traceback (most recent call last):
  File "/home/ibiam/Activities/flappy-birds-activity/main.py", line 121, in make
    self.initialize()
  File "/home/ibiam/Activities/flappy-birds-activity/main.py", line 100, in initialize
    ), background)
  File "/home/ibiam/Activities/flappy-birds-activity/main.py", line 99, in <lambda>
    img, (self.width, img.get_height() * self.scaling_factor)
TypeError: integer argument expected, got float
1657153947.678694 ERROR root: Event queue full!
1657153947.693917 ERROR root: Event queue full!
1657153947.710997 ERROR root: Event queue full!
1657153947.728417 ERROR root: Event queue full!
1657153947.745286 ERROR root: Event queue full!
1657153947.761070 ERROR root: Event queue full!
1657153947.778083 ERROR root: Event queue full!
1657153947.793622 ERROR root: Event queue full!
1657153947.810643 ERROR root: Event queue full!
1657153947.827930 ERROR root: Event queue full!
sparshg commented 2 years ago

Fixed, this didn't happen on my setup though, I think sugar uses older version of pygame. I fixed it on python 3.6 and pygame 1.9.4 and now it works on that.

chimosky commented 2 years ago

Tested, works as expected.

Fixed, this didn't happen on my setup though, I think sugar uses older version of pygame. I fixed it on python 3.6 and pygame 1.9.4 and now it works on that.

My tests were with pygame v1.9.4, could you also state the int conversion done in your commit message as that's part of the reasons why you made the commit.

chimosky commented 2 years ago

Could you break the commit message to a title and a body that's after a new line? That'll be more helpful.