Habe folgendes Problem: Möchte, dass mein Player die Balls (in dem Falle Münzen) auffängt, die random (zufällig runterfallen). Der Code zeigt keinerlei Fehlermeldung, allerdings erscheinen auch keine Münzen. Was mache ich falsch? (Eingerückt ist alles, allerdings zerhaut es die Formatierung hier). Bin für jede Hilfe dankbar!
Anbei mein Code:
import pygame
import random
from pygame.sprite import Sprite
pygame.init()
# Create the fleet of aliens.
gf.create_fleet(bg_settings, screen, boy, balls)
# Make a ball
ball = Ball(bg_settings, screen)
# Start the main loop for the game.
while True:
gf.check_events(boy)
boy.update()
gf.update_balls(balls)
gf.update_screen(bg_settings, screen, boy, balls)
def update_balls(self):
if random() < 0.6: # 60% percent chance of making a ball drop
ball_index = randint(0, len(balls)-1)
balls[ball_index].is_falling = True
Habe folgendes Problem: Möchte, dass mein Player die ***** (in dem Falle Münzen) auffängt, die random (zufällig runterfallen). Der Code zeigt keinerlei Fehlermeldung, allerdings erscheinen auch keine Münzen. Was mache ich falsch? (Eingerückt ist alles, allerdings zerhaut es die Formatierung hier). Bin für jede Hilfe dankbar!
Please use [ code ] tag to show your code, this is unreadable, it also has some weird unused code. If you don't call your generator function inside your loop it won't show anything
[Selling] OBJECT 907, T-22 MEDIUM, OBJECT 260, 121B, OBJECT 279 EARLY, T95/FV4201 CHIEFT 12/16/2020 - World of Tanks Trading - 0 Replies EU SERVER
WN8 - 3046; WN7 - 1905; Rate of wins - 62%
AMX 50 B, E100, IS-7, S. Conqueror, T110E5, T57 Heavy, IS-4, Kranvagn, 113, WZ-111 5A, Type 5 Heavy, Obj. 277, Bat.-Châtillon 25 t,
E 50 Ausf. M, Leopard 1, M48A5 Patton, Object 140, T-62A, Jagdpanzer E 100, TVP T 50/51, Centurion Action X, Grille 15, STB-1, AMX 30 B, T57 Heavy Tank,
FV4005 Stage II, Object 261,
XM551 Sheridan, Object 430U, T-100 LT, Object 268 Version 4, AMX 13 105, WZ-111 model 5A,
WZ-132-1, Type 5 Heavy,...
[Selling] FV215b, M60, Object 907, T-22 medium, Object 260, 121B, Object 279 early, T95/FV4201 11/15/2020 - World of Tanks Trading - 0 Replies EU ACCOUNT
45000 battles, 61% wins
In hangar: 30 tiers 10 level
and special tiers: FV215b, M60, Object 907, T-22 medium, Object 260, 121B, Object 279 early, T95/FV4201 Chieftain
25 premium tiers 8 lvl
Write to:
WhatsApp: +79050356196
Instagram: mamiev10z
email:[email protected]
Facebook: https://www.facebook.com/profile.php?id=1000014433 23712
[Selling] Object 260 + Object 907 + 26 tier X + 3 tier IX + 18 premium + 56 in garage [430 EUR] 04/14/2017 - World of Tanks Trading - 2 Replies I'm selling this World of Tanks WoT account on EU server + Clean dedicated email included.
Server: EU
Battles: 37 800
Winrate: 54.53%
WN8: 1 910
Gold: 1 180
Credits: 9 000 000
Free experience: 8 400
[Selling] Great account with Object 260 + Object 907 + 14 Tier X + 20000 Gold 04/11/2016 - World of Tanks Trading - 3 Replies I'm selling this World of Tanks WoT account on EU server + Clean dedicated email included. No telephone added to the account, so the account is ready to be sold.
Battles: 32 000
Winrate: 53.70% (last 1000 battles: 56%)
WN8: 1700 (last 1000 battles: 2800)
Server: EU
Gold: 18 000
Credits: 2 900 000
Free experience: 0