-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: enable cow crossing condition, and horn action #1376
feat: enable cow crossing condition, and horn action #1376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 16 files at r1, 10 of 27 files at r2, 16 of 16 files at r3, 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 12 unresolved discussions (waiting on @sebp999)
game/migrations/0077_auto_20221106_1608_data.py
line 1 at r4 (raw file):
# Generated by Django 3.2.15 on 2022-11-06 16:08
Can you rename this migration please to reflect what it does? (although I can see it does a few things so maybe something like update_blocks
?
game/migrations/0077_auto_20221106_1608_data.py
line 37 at r4 (raw file):
Block = apps.get_model("game", "Block") Block.objects.filter(type="puff_up").delete() Block.objects.filter(type="declare_event").delete()
Just using get
instead of filter
should work here
Code quote:
Block.objects.filter(type="puff_up").delete()
Block.objects.filter(type="declare_event").delete()
game/migrations/0078_merge_20221127_1108.py
line 1 at r4 (raw file):
# Generated by Django 3.2.16 on 2022-11-27 11:08
Do we need this merging of the migrations?
game/migrations/0079_alter_block_options.py
line 1 at r4 (raw file):
# Generated by Django 3.2.16 on 2022-11-27 11:09
If I understand correctly this migration exists because you've edited the Block
model again after adding the options.
Maybe it would be cleaner to delete migrations 79 and 76, and re-run makemigrations
which would combine them anyway. And then keep 77 as you have it now. That way we end up with just 2 migrations overall
game/static/game/js/map.js
line 50 at r4 (raw file):
nextCoordinates.x = currentNode.coordinate.x + 1; if (nextCoordinates.x > 9) { // right-most extremity return null;
extra whitespaces here
game/static/game/js/map.js
line 59 at r4 (raw file):
} } else { // moving vertically nextCoordinates.x = currentNode.coordinate.x;
Extra whitespace here
game/static/game/js/model.js
line 106 at r4 (raw file):
if (cow) { return true; }
Extra whitespace
game/static/game/js/model.js
line 439 at r4 (raw file):
}; });
Extra whitespaces
game/static/game/js/model.js
line 581 at r4 (raw file):
for (var i = 0; i < this.trafficLights.length; i++) { var light = this.trafficLights[i];
Extra whitespaces
game/static/game/js/model.js
line 610 at r4 (raw file):
if (typeof(state) === "string") { state = [state]; }
Extra whitespace
game/static/game/js/model.js
line 613 at r4 (raw file):
if (state.includes(cow.activeNodes[jsonCoordinate])) { return cow; }
Extra whitespace
game/templates/game/level_editor.html
line 341 at r4 (raw file):
<td><img id="cow" src="/static/game/image/Clarice.svg" width="80"></td> <td>
Extra whitespaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 27 of 36 files reviewed, 12 unresolved discussions (waiting on @faucomte97)
game/static/game/js/map.js
line 50 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
extra whitespaces here
Done.
game/static/game/js/map.js
line 59 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Extra whitespace here
Done.
game/static/game/js/model.js
line 106 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Extra whitespace
Done.
game/static/game/js/model.js
line 439 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Extra whitespaces
Done.
game/static/game/js/model.js
line 581 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Extra whitespaces
Done.
game/static/game/js/model.js
line 610 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Extra whitespace
Done.
game/static/game/js/model.js
line 613 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Extra whitespace
Done.
game/templates/game/level_editor.html
line 341 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Extra whitespaces
Done.
game/migrations/0078_merge_20221127_1108.py
line 1 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Do we need this merging of the migrations?
Removed
game/migrations/0077_auto_20221106_1608_data.py
line 1 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Can you rename this migration please to reflect what it does? (although I can see it does a few things so maybe something like
update_blocks
?
Done.
game/migrations/0077_auto_20221106_1608_data.py
line 37 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Just using
get
instead offilter
should work here
I just prefer filter because type isn't a unique constraint and if there were 2 then get
would break
game/migrations/0079_alter_block_options.py
line 1 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
If I understand correctly this migration exists because you've edited the
Block
model again after adding the options.
Maybe it would be cleaner to delete migrations 79 and 76, and re-runmakemigrations
which would combine them anyway. And then keep 77 as you have it now. That way we end up with just 2 migrations overall
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 9 files at r5, all commit messages.
Reviewable status: 33 of 36 files reviewed, 3 unresolved discussions (waiting on @sebp999)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 9 files at r5.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @sebp999)
game/migrations/0077_auto_20221106_1608_data.py
line 37 at r4 (raw file):
Previously, sebp999 wrote…
I just prefer filter because type isn't a unique constraint and if there were 2 then
get
would break
ok 👍
game/migrations/0079_alter_block_options.py
line 1 at r4 (raw file):
Previously, sebp999 wrote…
Done.
Looks good, although I think you're gonna have to just change the numbering now because we've since merged a new migration that we've labelled as 0077, so this one will now need to be 0078 and the next one 0079
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 30 of 36 files reviewed, 1 unresolved discussion (waiting on @faucomte97)
game/migrations/0079_alter_block_options.py
line 1 at r4 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Looks good, although I think you're gonna have to just change the numbering now because we've since merged a new migration that we've labelled as 0077, so this one will now need to be 0078 and the next one 0079
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 7 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @sebp999)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @sebp999)
Codecov Report
@@ Coverage Diff @@
## master #1376 +/- ##
==========================================
+ Coverage 91.52% 91.54% +0.01%
==========================================
Files 100 102 +2
Lines 5512 5536 +24
==========================================
+ Hits 5045 5068 +23
- Misses 467 468 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @sebp999)
Description
Fixes #1334 #1335 #1843 #952 (partly)
Add
Remove
The cows are now not random but set up, like traffic lights. Horns remove all cows, so puffing up and down to remove brown cows is also gone.
How Has This Been Tested?
Manually using several scenarios. Cow collisions are already tested. The next PR (will be added later) adds a simple level demonstrating cows and the corresponding runthrough test will test it.
Checklist:
This change is