Beginner Python Arcade Issue /u/__R3v3nant__ Python Education

So I have this sprite that I want to draw and here is the code in the class MyGame

def on_draw(self): """ Draw everything """ self.clear() self.game.PlacedownPile.draw() 

And here is the class

class PlaceDownPile(arcade.Sprite): def __init__(self,colour="null",number="null",type="null",special = False,scale=0.2): super().__init__(scale=scale) self.colour = colour self.number = number self.type = type self.special = special self.card = [] self.image_file_name = f":OBlue.jpg" self.center_y = 4 self.center_x = 4 def PickAColour(self,Game): Game.RecieveBroadcast("PickAColour") def ChangeLook(self): card = self.card[0] self.image_file_name = card.getTexture() def Change(self,game): card = self.card[0] self.colour = "null" self.colour = card.getColour() #self.ChangeLook() if self.colour == "null": self.PickAColour(game) self.number = card.getNumber() self.type = card.getType() self.special = card.getIfSpecial() def ChangeColour(self,colour): # changes colour self.colour = colour def GetCardDeck(self,DrawPile,Game): # gets a card from the deck self.card += DrawPile.createplacedownpile() self.Change(Game) def removeACard(self, a): # removes a card self.removed = self.card[0] a.recievePlaceDownCard(self.removed) self.card.pop(0) def GetCardPlayer(self,Player,DrawPile,game): # gets cards from a player self.card += Player.playCard() self.removeACard(DrawPile) self.Change(game) def __str__(self): printout = "" printout += str(self.card[0]) return printout 

But when I execute the program it just doesn’t draw, it only draws the background, can anyone explain why?

submitted by /u/__R3v3nant__
[link] [comments]

​r/learnpython So I have this sprite that I want to draw and here is the code in the class MyGame def on_draw(self): “”” Draw everything “”” self.clear() self.game.PlacedownPile.draw() And here is the class class PlaceDownPile(arcade.Sprite): def __init__(self,colour=”null”,number=”null”,type=”null”,special = False,scale=0.2): super().__init__(scale=scale) self.colour = colour self.number = number self.type = type self.special = special self.card = [] self.image_file_name = f”:OBlue.jpg” self.center_y = 4 self.center_x = 4 def PickAColour(self,Game): Game.RecieveBroadcast(“PickAColour”) def ChangeLook(self): card = self.card[0] self.image_file_name = card.getTexture() def Change(self,game): card = self.card[0] self.colour = “null” self.colour = card.getColour() #self.ChangeLook() if self.colour == “null”: self.PickAColour(game) self.number = card.getNumber() self.type = card.getType() self.special = card.getIfSpecial() def ChangeColour(self,colour): # changes colour self.colour = colour def GetCardDeck(self,DrawPile,Game): # gets a card from the deck self.card += DrawPile.createplacedownpile() self.Change(Game) def removeACard(self, a): # removes a card self.removed = self.card[0] a.recievePlaceDownCard(self.removed) self.card.pop(0) def GetCardPlayer(self,Player,DrawPile,game): # gets cards from a player self.card += Player.playCard() self.removeACard(DrawPile) self.Change(game) def __str__(self): printout = “” printout += str(self.card[0]) return printout But when I execute the program it just doesn’t draw, it only draws the background, can anyone explain why? submitted by /u/__R3v3nant__ [link] [comments] 

So I have this sprite that I want to draw and here is the code in the class MyGame

def on_draw(self): """ Draw everything """ self.clear() self.game.PlacedownPile.draw() 

And here is the class

class PlaceDownPile(arcade.Sprite): def __init__(self,colour="null",number="null",type="null",special = False,scale=0.2): super().__init__(scale=scale) self.colour = colour self.number = number self.type = type self.special = special self.card = [] self.image_file_name = f":OBlue.jpg" self.center_y = 4 self.center_x = 4 def PickAColour(self,Game): Game.RecieveBroadcast("PickAColour") def ChangeLook(self): card = self.card[0] self.image_file_name = card.getTexture() def Change(self,game): card = self.card[0] self.colour = "null" self.colour = card.getColour() #self.ChangeLook() if self.colour == "null": self.PickAColour(game) self.number = card.getNumber() self.type = card.getType() self.special = card.getIfSpecial() def ChangeColour(self,colour): # changes colour self.colour = colour def GetCardDeck(self,DrawPile,Game): # gets a card from the deck self.card += DrawPile.createplacedownpile() self.Change(Game) def removeACard(self, a): # removes a card self.removed = self.card[0] a.recievePlaceDownCard(self.removed) self.card.pop(0) def GetCardPlayer(self,Player,DrawPile,game): # gets cards from a player self.card += Player.playCard() self.removeACard(DrawPile) self.Change(game) def __str__(self): printout = "" printout += str(self.card[0]) return printout 

But when I execute the program it just doesn’t draw, it only draws the background, can anyone explain why?

submitted by /u/__R3v3nant__
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *