PyWeek 31 challenge: “Cops”
Airlift One - Goals
Posted by Matthgeek on 2021/03/30 15:23
Next up: Keeping track of what's on the hovercraft.
Note: Due to complicated reasons, my screenshots will consist of me taking pictures of my screen with my phone.
PrisonScape - Late start
Posted by YannThor on 2021/03/30 13:05
As I need a project simple enough to be finished by the end of the week, I'll try to make a platformer as fun as possible.
Cool Cop - Escape Game - First update
Posted by coffee on 2021/03/30 10:29
As we lost a lot of time struggling there we only started development on Monday.
Yet we are making good progress at this point and currently we are able to load a tile map, have implemented a (hopefully useful) architecture and the player is able to move.
So while we started off slow we now start picking up momentum...
I'll Cop Your Heart - Day 3: Making Art
Posted by doodletaco on 2021/03/30 09:39
Copcake Caper - Day 2: Slow And Study
Posted by Chard on 2021/03/30 06:30
We're still getting our core gameplay together. Meanwhile the art workflow seems be working pretty well and we're seeing all kinds of fun character art showing up. This is the first time we've tried to incorporate automated testing into our development for PyWeek and I'm really glad we did because our game model is showing up all kinds of edge cases and it would be very hard to be sure it is working otherwise.
Anyway, more details coming soon. In the meantime if you know what we drew here then please let us know!
Chocolate Turtwig - Send Help # 1
Posted by rx on 2021/03/30 05:44
Gnorman's Copse - What's a copse?
Posted by Cosmologicon on 2021/03/29 22:15
"Copse" is a homophone that means a small cluster of trees, so that's what I'll make a game about! I'm expecting the possibility of comments saying I used the theme wrong, but I'll live. As long as it's clear I didn't ignore the theme. Here's some stock image inspiration:
Donut Run - Day 2: Enemies and shootouts
Posted by karx on 2021/03/29 21:56
adj_odds = int(200 * (1 / 60) / delta_time)Code for adjusting odds for delta time
Freecity Patrol - Day 2: I DID IT. ASPECT RATIOS. Well, not really.
Posted by Aimarekin on 2021/03/29 21:22
Every engine I've used so far had some sort of automatic scaling for when the user resized their window. But, python? Yeah, forget about any kind of help.
This was a pain. There was absolutely 0 documentation about how to implement this on Arcade, which is the module I'm using. I want my game to keep it's aspect ratio no matter how the user resizes the window, by adding black bars to the sides. It took me 45 minutes for my brain to use 5% of it's processing power and realize this:
(orig height/orig width) = (new height/new width) Therefore (orig height/orig width) * new width = new height (orig width/orig height) * new height = new width
So simple, but my small brain kept searching for complicated equations, algorithms and formulas that were just not necessary.
Afterwards, I spend a good time looking at the docs. That set_viewport function wasn't even that complicated. But my brain refuses to believe things can be simple. I'm kind of contradicting myself now, aren't I?
That was not the end of it. This is the code I made:
if width <= height: # Width is smaller or equal r_width = width s_width = 0 r_height= math.ceil((500/800)*width) s_height = math.floor((height - r_height)/2) self.set_viewport(-s_width, r_width+s_width, -s_height, r_height+s_height) print(f"\nResized to {width}, {height}.\nWidth is smaller.\nResult is {width}, {(500/800)*width}\n") else: # Height is smaller print(f"\nResized to {width}, {height}.\nHeight is smaller.\nResult is {(800/500)*height}, {height}\n") r_width = math.ceil((800/500)*height) s_width = math.floor((width - r_width)/2) r_height= height s_height = 0 self.set_viewport(-s_width, r_width+s_width, -s_height, r_height+s_height)
It basically tries to make the content inside as big as possible within the space available in the window. But since I'm not accounting for aspect ratios in the conditions, it doesn't detect when it has to switch modes very well. Also, making the width smaller breaks it and doesn't correctly center or scale the content. Here's a picture to embarrass myself.
TL;DR: Two days and I can't even handle aspect ratios. I better calm down and lower expectatives. Good luck to everyone!
SPI-COP - second day - an Engine for the NPCs .. more or less
Posted by MasterPice on 2021/03/29 20:38
- it can move,
- hit the wall ( and react),
- has some looks to choose from,
- can change the looks depending on the state ( standing, walking, ..),
There are some managing classes, to take care of some NPC stuff... ( like images to be loaded, size ratios, animation frames, position, wall detection,....):
- the "Cloth" class // for all the clothes of an NPC
- the "walker" class // for walking throu the game
There is a beginning of a manager (that is there for):
- NPCs don't just walk into each other ( in some way ..),
- NPCs will be stoppable from outside (= the user),
There is a Vector class... // we made it rather simple... not much to say...