Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

polastyn submission #46

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
31eee2c
personal folder
Oct 6, 2021
24881ca
flood_iter.py - added
Oct 6, 2021
7dbde94
fog.py - added
Oct 6, 2021
d3c236e
fog test 1
Oct 7, 2021
d5518dc
small fix for lib
Oct 7, 2021
35084f3
entry end commit
Oct 7, 2021
12f5614
small license fix
Oct 7, 2021
e139e68
add iterations number to flood_iter.py
Oct 8, 2021
1df4606
smooth shadows
Oct 8, 2021
f8c2f08
joined fog lightening mechanic
Oct 8, 2021
6fc43d5
wip
ddorn Oct 3, 2021
4808890
02: player movement
ddorn Oct 9, 2021
11176df
02: add asteroids
ddorn Oct 10, 2021
93f7442
02: fix no wrapping screen in corners
ddorn Oct 10, 2021
17b4833
02: asteroids break
ddorn Oct 10, 2021
1535c73
use a state class + player collision + fps counter
ddorn Oct 10, 2021
dd3bef1
wip: readmes
ddorn Oct 11, 2021
b2b9dbc
Emc2356 entry
Emc2356 Oct 11, 2021
e321966
ghast entry
davidpendergast Oct 11, 2021
5334d3f
CoopERR entry
pootsieMopeyMoop Oct 11, 2021
2ec4e47
Baconivader entry
Baconinvader Oct 11, 2021
7f18f71
tank-king entry
tank-king Oct 11, 2021
aeab065
alley-indie entry
alley-indie Oct 11, 2021
5d294e7
MegaIng entry
MegaIng Oct 11, 2021
8572eb8
bydariogamer entry
bydariogamer Oct 11, 2021
865dea1
zxxv entry
hodgka Oct 11, 2021
286d717
gresm entry
gresm Oct 11, 2021
ca39ed8
fkS#2984 entry
ddorn Oct 11, 2021
0ea0128
bitcraft entry
bitcraft Oct 11, 2021
a8fcc28
Abalue entry
Abalue Oct 11, 2021
47d5ff7
andenixa entry
ddorn Oct 11, 2021
3343a38
grimmys entry
ddorn Oct 11, 2021
93f5338
arosso17 entry
ddorn Oct 11, 2021
6cce919
Blaatand29 entry
ddorn Oct 11, 2021
144b473
Miku entry
ddorn Oct 11, 2021
a917d99
RoboMarchello entry
ddorn Oct 11, 2021
dc67db1
auto-format with black
ddorn Oct 11, 2021
7584565
New version of the showcase + allow external modules (#17)
ddorn Oct 11, 2021
fe0c084
make all entries work together
ddorn Oct 11, 2021
a20deaf
CozyFractal entry
ddorn Oct 11, 2021
ef89e94
scroll in showcase
ddorn Oct 11, 2021
ad91df3
small fixes
ddorn Oct 11, 2021
7706f5c
big showcase speed boost
ddorn Oct 11, 2021
70b3b0f
showcase: smooth scroll
ddorn Oct 11, 2021
c369a88
showcase: load apps one by one for smoother menu open
ddorn Oct 11, 2021
06f293f
Merge branch 'master' into 02-add
ddorn Oct 12, 2021
90f9346
02: readmes
ddorn Oct 13, 2021
53ba39f
improve code quality + toggle fps cap
ddorn Oct 14, 2021
243f0e8
02: improve code quality
ddorn Oct 14, 2021
f6d48d8
02: final version
ddorn Oct 14, 2021
4fc5de0
Merge branch 'master' of https://github.com/PygameCommunityDiscord/We…
Oct 14, 2021
e655b06
added 'polastyn2030' folder
Oct 14, 2021
5acd09a
make python 3.6 work
ddorn Oct 14, 2021
a251889
dicord tag added
Oct 14, 2021
f5a65b7
Merge branch 'PygameCommunityDiscord:master' into master
gresm Oct 16, 2021
0f11636
+ particle_system.py - added
Oct 16, 2021
4566a8b
~ particle_system.py - dynamic surface added
Oct 19, 2021
7ac080d
~ particle_system.py - sprite support for particles
Oct 23, 2021
3fc1fcf
~ particle_system.py - BaseParticleSpawner added
Oct 23, 2021
2a901ed
~ particle_system.py - burst functionality added
Oct 23, 2021
9e46a0a
~ particle_system_template.py - added
Oct 25, 2021
5f543bb
~ particle_system.py - loading from template (in progress)
Oct 25, 2021
043fa7e
~ particle_system.py - finished?
Oct 25, 2021
c241225
~ particle_system.py - bug hunted
Oct 25, 2021
4146498
~ particle_system.py - bug hunting part 2
Oct 27, 2021
1771c11
Merge remote-tracking branch 'origin/master' into PygameCommunityDisc…
Oct 27, 2021
79b4eef
~ particle_system.py - limit to particle generator added
Oct 27, 2021
fe2eb06
~ particle_system.py - added functionality to offset RandomFloat range
Oct 27, 2021
6087497
Merge branch 'PygameCommunityDiscord:master' into master
gresm Nov 27, 2021
f0e5a1e
+ my_entry (for bouncing bubbles)
Nov 27, 2021
72f7f0f
~ main.py - collision detection
Nov 27, 2021
3b2d141
~ main.py - debug info added
Nov 28, 2021
1b56a13
~ main.py - walls collision simple
Nov 28, 2021
f92f716
~ main.py - walls collision final
Nov 28, 2021
09e4f46
~ main.py - 1 todo removed
Nov 29, 2021
96e1e2a
~ main.py - first try to make bouncing bubbles
Nov 29, 2021
fd322c7
~ main.py - bouncing bubbles (final)
Nov 29, 2021
62f5fcb
~ main.py - removed all TODOs
Nov 29, 2021
b5c9e40
~ main.py - + 1TODO
Nov 30, 2021
a51b84f
~ main.py - added weak support for rectangles
Nov 30, 2021
8f62113
~ main.py - added weak support for rectangle collisions
Dec 1, 2021
356b1db
~ main.py - fixed call order for applying rotation
Dec 1, 2021
c40dc83
~ main.py - rotation?
Dec 1, 2021
6ab6ab0
~ main.py - collisions (half way done)
Dec 1, 2021
a6a683e
~ main.py - final commit
Dec 1, 2021
dca1347
~ 04-bouncing-bubbles/ - code cleanup
Dec 1, 2021
ff57b64
Merge branch 'pygame-community:master' into master
gresm Sep 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions 02-particle-system/polastyn2030/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import sys
from pathlib import Path

try:
import wclib
except ImportError:
# wclib may not be in the path because of the architecture
# of all the challenges and the fact that there are many
# way to run them (through the showcase, or on their own)

ROOT_FOLDER = Path(__file__).parent.parent.parent
sys.path.append(str(ROOT_FOLDER))
import wclib

# This line tells python how to handle the relative imports
# when you run this file directly.
__package__ = "02-particle-system." + Path(__file__).parent.name

# ---- Recommended: don't modify anything above this line ---- #

# Metadata about your submission
__author__ = "polastyn#7640" # Put yours!
__achievements__ = [ # Uncomment the ones you've done
# "Casual",
# "Ambitious",
"Adventurous",
]

# To import the modules in yourname/, you need to use relative imports,
# otherwise your project will not be compatible with the showcase.
# noinspection PyPackages
from .objects import *
# noinspection PyPackages
from .particle_system import load_particle_spawner as load
# noinspection PyPackages
from .particle_system_template import ParticleTemplate, SpawnerTemplate
# noinspection PyPackages
from . import particle_system as par

BACKGROUND = 0x0F1012


def mainloop():
pygame.init()

player = Player((SIZE[0] / 2, SIZE[1] / 2), (0, 0))
# The state is just a collection of all the objects in the game
state = State(player, FpsCounter(60), *Asteroid.generate_many())
image = pygame.Surface((10, 10))
image.fill((255, 255, 255))
spawner = load(
ParticleTemplate(life_time=10, size=(5, 5), speed=(10, 20)),
image, SpawnerTemplate(spawn_pos=(30, 30, 30), spawn_delay=0, limit=10)
)
spawner.info.spawn_pos = par.RemotePos(player, "center")
spawner_angle = par.RandomFloat(-10, 10)
spawner.info.object_info.angle = spawner_angle

while True:
screen, events = yield
for event in events:
if event.type == pygame.QUIT:
return
else:
state.handle_event(event)

# Note: the logic for collisions is in the Asteroids class.
# This may seem arbitrary, but the only collisions that we consider
# are with asteroids.
state.logic()
spawner_angle.move_center(-player.rotation+90)
spawner.update()

screen.fill(BACKGROUND)
spawner.draw(screen)
state.draw(screen)


if __name__ == "__main__":
wclib.run(mainloop())
Loading