rune drawing again
* Rune drawing behaves strange on my computer when running in fullscreen* While intermission texts are floating through the screen, mouse is sometimes stuck in rune drawing mode.
If you encounter any of these problems, please switch to windowed mode with the -w switch, and also tell us please, so we could fix it. Thanks!
(log in to comment)
Comments
Traceback (most recent call last): File "run_game.py", line 13, in ? main.main() File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/main.py", line 97, in main scene.run() File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Scene.py", line 258, in run s.update(elapsed_time) File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Enemy.py", line 47, in update AccelSprite.update(self, elapsed_msecs) File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Sprite.py", line 274, in update self.out_of_screen_cbfn(*self.out_of_screen_cbpars) File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Scene.py", line 484, in enemy_left_screen self.check_wave_stage() File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Scene.py", line 493, in check_wave_stage self.advance_stage() File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Scene.py", line 659, in advance_stage hint = HintTextSprite(config.SCREEN_WIDTH / 2, config.SCREEN_HEIGHT - 50, self.act_stage.hint_text, (255, 255, 255), 24, "burti_bold.ttf", self.act_stage.fade_in_time, self.act_stage.display_time, self.act_stage.fade_out_time) File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Sprite.py", line 407, in __init__ TextSprite.__init__(self, x, y, text, color, size, font, False, (0, 0, 0), 2) File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Sprite.py", line 336, in __init__ self.set_text(text, color, size, font, antialias, shadow, shadow_offs) File "/home/alecu/Desktop/pyweek-4-finals/Mindless_pw4/sky_journey-v1.0b/lib/Sprite.py", line 362, in set_text self.surf = self.font.render(self.text, self.antialias, self.color) pygame.error: SDL_ttf render failedWeird, eh?
I found this:
"""
Actually, you only get this if you call font.render with a string that
contains a space character, and with antialias set to False.
Seems to be a known bug in the SDL_ttf version that is in Ubuntu.
"""
A solution would be to modify line 407 of Sprite.py:
from
TextSprite.__init__(self, x, y, text, color, size, font, False, (0, 0, 0), 2)
to
TextSprite.__init__(self, x, y, text, color, size, font, True, (0, 0, 0), 2)
I hope this helps.
Happy playing!
Ron
KukkerMan
- As eugman has pointed out it runs only from the console, ergo you have to start it from the direcory where the game resides.
- pygame.error: No free channels available (thanks tenuki): increased SDL mixer channels from 8 to 16.
- pygame.error: SDL_ttf render failed (thanks alecu): try...catch workaroud for Ubuntu users.
Just unpack it into the game's directory and overwrite the existing files.
KukkerMan
Traceback (most recent call last): File "run_game.py", line 13, in main.main() File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/main.py", line 97, in main scene.run() File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Scene.py", line 287, in run self.missile_hit(enemy, m, rect) File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Scene.py", line 566, in missile_hit self.enemy_killed(enemy) File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Scene.py", line 488, in enemy_killed self.check_wave_stage() File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Scene.py", line 493, in check_wave_stage self.advance_stage() File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Scene.py", line 659, in advance_stage hint = HintTextSprite(config.SCREEN_WIDTH / 2, config.SCREEN_HEIGHT - 50, self.act_stage.hint_text, (255, 255, 255), 24, "burti_bold.ttf", self.act_stage.fade_in_time, self.act_stage.display_time, self.act_stage.fade_out_time) File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Sprite.py", line 407, in __init__ TextSprite.__init__(self, x, y, text, color, size, font, False, (0, 0, 0), 2) File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Sprite.py", line 336, in __init__ self.set_text(text, color, size, font, antialias, shadow, shadow_offs) File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Sprite.py", line 362, in set_text self.surf = self.font.render(self.text, self.antialias, self.color) pygame.error: SDL_ttf render failed
Traceback (most recent call last): File "run_game.py", line 13, in main.main() File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/main.py", line 97, in main scene.run() File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Scene.py", line 320, in run self.hit_balloon(enemy, rect) File "/home/riq/src/pyweek4/sky_journey-v1.0b/lib/Scene.py", line 682, in hit_balloon self.enemies.remove(enemy) ValueError: list.remove(x): x not in list
The problem was that the balloon is assembled from multiple hitboxes and when a monster collides with the balloon it is possible that two or more hitboxes overlap each other at the same time and the monster is added to the collide list multiple times. When the colliding mosters are removed later this particular one will be tried more than one. The first succeeds the second... ends in a traceback. :)
Patch is updated and can be downloaded from here.
KukkerMan
I'll try again later, but it seems to be way too picky for me, i haven't completed one single rune after 15-30 mins of trying, and it is rather frustrating :/
I even tried moving the mouse in random directions, to no avail, is there something I'm missing?
i did the square rune at first try... wasn't too hard. there is a certain "direction" you have to draw the rune! take a look at the tutorial
i'll try drawing the other runes when i'm seriously testing the game... so many entries :-)
and did finally succeed at the square one, but only twice, I guess I'm just not that good at it ;)
Yeah, rune drawing may be a bit tricky for first. Here are some "insider tips" that may help you to draw runes:
- The size of the rune doesn't matter. The method checks for the relative motion of the mouse between "pauses" in motion, that is corners of the shape. This is why our runes have sharp corners. So you should try not to smooth the movement when drawing the rune, but make sharp stops at the corners.
- The eight (trivial) directions are detected as relative motion, each having a tolerance angle of plus and minus 22.5 degrees. If you draw a bit larger shapes, it is easier to stay inside the tolerance zone. For example, the square may be easy to draw, because horizontal and vertical lines build it, but the triangle is defined as "down-left, right, up-left". This is a bit "flat" triangle, not an equal-sided one.. sometimes the diagonals are badly drawn more as verticals. (ok, this is more of a problem of our shape detecion method rather than a failure of mankind :)..we are planning for something more robust in the future)
Have fun playing!
Ron
simono on 2007/04/09 17:40:
hm, didn't have those problems with python2.5, winXP.. but rune drawing is tough - good that there is a tutorial with tips.