diff --git a/app/bloonsa_game/models.py b/app/bloonsa_game/models.py index 7942264..5e0398f 100644 --- a/app/bloonsa_game/models.py +++ b/app/bloonsa_game/models.py @@ -1,5 +1,3 @@ -import math - from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models from django.db.models import Avg @@ -42,7 +40,7 @@ class Level(models.Model): @property def stars(self): result = list(self.bloonsa_level_ratings.aggregate(Avg("rating")).values())[0] - return 0 if result is None else math.ceil(result) + return 0 if result is None else round(result) def __str__(self): diff --git a/app/bloonsa_game/static/bloonsa_game/js/flash_handler.js b/app/bloonsa_game/static/bloonsa_game/js/flash_handler.js index 5e9e01f..b3f7b5d 100644 --- a/app/bloonsa_game/static/bloonsa_game/js/flash_handler.js +++ b/app/bloonsa_game/static/bloonsa_game/js/flash_handler.js @@ -8,6 +8,12 @@ function bloonsa_level_completed(level_id) { bloonsa_update_data(level_id) } +function bloonsa_rated_level_success(level_id) { + console.log("call to bloonsa_rated_level_success"); + bloonsa_update_data(level_id) +} + + function bloonsa_update_data(level_id) { const xhr = new XMLHttpRequest(); console.log("call to update_data"); diff --git a/app/bloonsa_game/static/bloonsa_game/misc/bloons_unlimited.swf b/app/bloonsa_game/static/bloonsa_game/misc/bloons_unlimited.swf index 5901c44..770ff3c 100644 Binary files a/app/bloonsa_game/static/bloonsa_game/misc/bloons_unlimited.swf and b/app/bloonsa_game/static/bloonsa_game/misc/bloons_unlimited.swf differ diff --git a/dev/debugging/double_js_bug_as3.txt b/dev/debugging/double_js_bug_as3.txt new file mode 100644 index 0000000..cd219ac --- /dev/null +++ b/dev/debugging/double_js_bug_as3.txt @@ -0,0 +1,13 @@ +bug triggers: +- RESET button in-game: _parent._parent.popgame.Init(); +- GO RANDOM button in-game: _parent._parent.popgame.GetRandomLevel(0); +- PLAY RANDOM button post-game: _parent._parent.popgame.GetRandomLevel(0); +- PLAY RANDOM button mainmenu: _parent.popgame.GetRandomLevel(0); + +doesn't trigger: +- REPLAY LEVEL button post-game: + _parent.dest = "play"; + _parent.gotoAndPlay("drawOff"); +- PLAY button from level-id in mainmenu: + _parent._parent.popgame.curLevel = loadthis_txt.text; + _parent._parent.gotoAndPlay("play"); \ No newline at end of file