pygame sprite not blitting onto screen when used draw function
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to make a game where there are two players firing bullets at each other. One of my players that comes from a class blits onto the screen successfully. but the second player which is from another class which is virtually a clone of player ones class which has all the same functions. but somehow does not work:
import pygame
import random
import sys
pygame.init()
screen = pygame.display.set_mode((1280, 720))
clock = pygame.time.Clock() # A clock to limit the frame rate.
pygame.display.set_caption("this game")
class Background:
picture = pygame.image.load("C:/images/cliff.jpg").convert()
picture = pygame.transform.scale(picture, (1280, 720))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
def draw(self):
screen.blit(self.picture, (self.xpos, self.ypos))
class player_first:
picture = pygame.image.load("C:/aliens/ezgif.com-crop.gif")
picture = pygame.transform.scale(picture, (200, 200))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
self.speed_x = 0
self.speed_y = 0
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
self.ypos += self.speed_y
def draw(self): #left right
#screen.blit(pygame.transform.flip(self.picture, True, False), self.rect)
screen.blit(self.picture, (self.xpos, self.ypos))
class player_second:
picture = pygame.image.load("C:/aliens/Giantmechanicalcrab2.gif")
picture = pygame.transform.scale(picture, (200, 200))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
self.speed_x = 0
self.speed_y = 0
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
self.ypos += self.speed_y
def draw(self): #left right
#screen.blit(pygame.transform.flip(self.picture, True, False), self.rect)
screen.blit(self.picture, (self.xpos, self.ypos))
class player_one_Bullet(pygame.sprite.Sprite):
picture = pygame.image.load("C:/aliens/giphy.gif").convert_alpha()
picture = pygame.transform.scale(picture, (100, 100))
def __init__(self):
self.xpos = 360
self.ypos = 360
self.speed_x = 0
super().__init__()
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
def draw(self):
screen.blit(self.picture, (self.xpos, self.ypos))
#self.screen.blit(pygame.transform.flip(self.picture, False, True), self.rect)
def is_collided_with(self, sprite):
return self.rect.colliderect(sprite.rect)
player_one = player_first(0, 0)
player_two = player_second(1280, 0)
cliff = Background(0, 0)
player_one_bullet_list = pygame.sprite.Group()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_w:
player_one.speed_y = -5
elif event.key == pygame.K_s:
player_one.speed_y = 5
elif event.key == pygame.K_UP:
player_two.speed_y = -5
elif event.key == pygame.K_DOWN:
player_two.speed_y = 5
elif event.key == pygame.K_SPACE:
player_one_bullet = player_one_Bullet()
player_one_bullet.ypos = player_one.ypos
player_one_bullet.xpos = player_one.xpos
player_one_bullet.speed_x = 14
player_one_bullet_list.add(player_one_bullet)
elif event.type == pygame.KEYUP:
# Stop moving when the keys are released.
if event.key == pygame.K_s and player_one.speed_y > 0:
player_one.speed_y = 0
elif event.key == pygame.K_w and player_one.speed_y < 0:
player_one.speed_y = 0
elif event.key == pygame.K_DOWN and player_one.speed_y > 0:
player_two.speed_y = 0
elif event.key == pygame.K_UP and player_one.speed_y < 0:
player_two.speed_y = 0
player_one.update()
player_two.update()
cliff.draw()
player_one.draw()
player_two.draw()
player_one_bullet_list.update()
for player_one_bullet in player_one_bullet_list:
player_one_bullet.draw()
pygame.display.flip()
clock.tick(60)
#IGNORE THIS
#player_one_bullet_list = pygame.sprite.Group()
#elif event.key == pygame.K_SPACE:
# player_one_bullet = player_one_Bullet()
#
# player_one_bullet.ypos = player_one.ypos
# player_one.xpos = player_one.xpos
#
# player_one_bullet.speed_x = 14
#
# player_one_bullet_list.add(player_one_bullet)
#
#
#player_one_bullet_list.update()
#
# for player_one_bullet in player_one_bullet_list:
#
player_one_bullet.draw()
python pygame
add a comment |
I am trying to make a game where there are two players firing bullets at each other. One of my players that comes from a class blits onto the screen successfully. but the second player which is from another class which is virtually a clone of player ones class which has all the same functions. but somehow does not work:
import pygame
import random
import sys
pygame.init()
screen = pygame.display.set_mode((1280, 720))
clock = pygame.time.Clock() # A clock to limit the frame rate.
pygame.display.set_caption("this game")
class Background:
picture = pygame.image.load("C:/images/cliff.jpg").convert()
picture = pygame.transform.scale(picture, (1280, 720))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
def draw(self):
screen.blit(self.picture, (self.xpos, self.ypos))
class player_first:
picture = pygame.image.load("C:/aliens/ezgif.com-crop.gif")
picture = pygame.transform.scale(picture, (200, 200))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
self.speed_x = 0
self.speed_y = 0
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
self.ypos += self.speed_y
def draw(self): #left right
#screen.blit(pygame.transform.flip(self.picture, True, False), self.rect)
screen.blit(self.picture, (self.xpos, self.ypos))
class player_second:
picture = pygame.image.load("C:/aliens/Giantmechanicalcrab2.gif")
picture = pygame.transform.scale(picture, (200, 200))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
self.speed_x = 0
self.speed_y = 0
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
self.ypos += self.speed_y
def draw(self): #left right
#screen.blit(pygame.transform.flip(self.picture, True, False), self.rect)
screen.blit(self.picture, (self.xpos, self.ypos))
class player_one_Bullet(pygame.sprite.Sprite):
picture = pygame.image.load("C:/aliens/giphy.gif").convert_alpha()
picture = pygame.transform.scale(picture, (100, 100))
def __init__(self):
self.xpos = 360
self.ypos = 360
self.speed_x = 0
super().__init__()
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
def draw(self):
screen.blit(self.picture, (self.xpos, self.ypos))
#self.screen.blit(pygame.transform.flip(self.picture, False, True), self.rect)
def is_collided_with(self, sprite):
return self.rect.colliderect(sprite.rect)
player_one = player_first(0, 0)
player_two = player_second(1280, 0)
cliff = Background(0, 0)
player_one_bullet_list = pygame.sprite.Group()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_w:
player_one.speed_y = -5
elif event.key == pygame.K_s:
player_one.speed_y = 5
elif event.key == pygame.K_UP:
player_two.speed_y = -5
elif event.key == pygame.K_DOWN:
player_two.speed_y = 5
elif event.key == pygame.K_SPACE:
player_one_bullet = player_one_Bullet()
player_one_bullet.ypos = player_one.ypos
player_one_bullet.xpos = player_one.xpos
player_one_bullet.speed_x = 14
player_one_bullet_list.add(player_one_bullet)
elif event.type == pygame.KEYUP:
# Stop moving when the keys are released.
if event.key == pygame.K_s and player_one.speed_y > 0:
player_one.speed_y = 0
elif event.key == pygame.K_w and player_one.speed_y < 0:
player_one.speed_y = 0
elif event.key == pygame.K_DOWN and player_one.speed_y > 0:
player_two.speed_y = 0
elif event.key == pygame.K_UP and player_one.speed_y < 0:
player_two.speed_y = 0
player_one.update()
player_two.update()
cliff.draw()
player_one.draw()
player_two.draw()
player_one_bullet_list.update()
for player_one_bullet in player_one_bullet_list:
player_one_bullet.draw()
pygame.display.flip()
clock.tick(60)
#IGNORE THIS
#player_one_bullet_list = pygame.sprite.Group()
#elif event.key == pygame.K_SPACE:
# player_one_bullet = player_one_Bullet()
#
# player_one_bullet.ypos = player_one.ypos
# player_one.xpos = player_one.xpos
#
# player_one_bullet.speed_x = 14
#
# player_one_bullet_list.add(player_one_bullet)
#
#
#player_one_bullet_list.update()
#
# for player_one_bullet in player_one_bullet_list:
#
player_one_bullet.draw()
python pygame
Would it work for you to post only the minimal amount of code that can reproduce this error? That way, those who can help you won't have to sort through lots of irrelevant stuff to find the issue. And you may even find the issue yourself when trying to reduce the code to the minimal example. Also it'd be good to include info on what you tried so far - for example, did you try a different image for player two to see if that was the problem? Also, are you sure the second player is in a position on the screen where they are expected to even be visible?
– Random Davis
Nov 26 '18 at 17:57
sorry the mistake was very obvious 😔
– user10632736
Nov 26 '18 at 18:34
Even so, you might want to add a self-answer to explain what the issue was, in case this question and your answer could help future readers.
– Random Davis
Nov 26 '18 at 18:36
the sprite was off screen
– user10632736
Nov 26 '18 at 18:37
add a comment |
I am trying to make a game where there are two players firing bullets at each other. One of my players that comes from a class blits onto the screen successfully. but the second player which is from another class which is virtually a clone of player ones class which has all the same functions. but somehow does not work:
import pygame
import random
import sys
pygame.init()
screen = pygame.display.set_mode((1280, 720))
clock = pygame.time.Clock() # A clock to limit the frame rate.
pygame.display.set_caption("this game")
class Background:
picture = pygame.image.load("C:/images/cliff.jpg").convert()
picture = pygame.transform.scale(picture, (1280, 720))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
def draw(self):
screen.blit(self.picture, (self.xpos, self.ypos))
class player_first:
picture = pygame.image.load("C:/aliens/ezgif.com-crop.gif")
picture = pygame.transform.scale(picture, (200, 200))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
self.speed_x = 0
self.speed_y = 0
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
self.ypos += self.speed_y
def draw(self): #left right
#screen.blit(pygame.transform.flip(self.picture, True, False), self.rect)
screen.blit(self.picture, (self.xpos, self.ypos))
class player_second:
picture = pygame.image.load("C:/aliens/Giantmechanicalcrab2.gif")
picture = pygame.transform.scale(picture, (200, 200))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
self.speed_x = 0
self.speed_y = 0
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
self.ypos += self.speed_y
def draw(self): #left right
#screen.blit(pygame.transform.flip(self.picture, True, False), self.rect)
screen.blit(self.picture, (self.xpos, self.ypos))
class player_one_Bullet(pygame.sprite.Sprite):
picture = pygame.image.load("C:/aliens/giphy.gif").convert_alpha()
picture = pygame.transform.scale(picture, (100, 100))
def __init__(self):
self.xpos = 360
self.ypos = 360
self.speed_x = 0
super().__init__()
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
def draw(self):
screen.blit(self.picture, (self.xpos, self.ypos))
#self.screen.blit(pygame.transform.flip(self.picture, False, True), self.rect)
def is_collided_with(self, sprite):
return self.rect.colliderect(sprite.rect)
player_one = player_first(0, 0)
player_two = player_second(1280, 0)
cliff = Background(0, 0)
player_one_bullet_list = pygame.sprite.Group()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_w:
player_one.speed_y = -5
elif event.key == pygame.K_s:
player_one.speed_y = 5
elif event.key == pygame.K_UP:
player_two.speed_y = -5
elif event.key == pygame.K_DOWN:
player_two.speed_y = 5
elif event.key == pygame.K_SPACE:
player_one_bullet = player_one_Bullet()
player_one_bullet.ypos = player_one.ypos
player_one_bullet.xpos = player_one.xpos
player_one_bullet.speed_x = 14
player_one_bullet_list.add(player_one_bullet)
elif event.type == pygame.KEYUP:
# Stop moving when the keys are released.
if event.key == pygame.K_s and player_one.speed_y > 0:
player_one.speed_y = 0
elif event.key == pygame.K_w and player_one.speed_y < 0:
player_one.speed_y = 0
elif event.key == pygame.K_DOWN and player_one.speed_y > 0:
player_two.speed_y = 0
elif event.key == pygame.K_UP and player_one.speed_y < 0:
player_two.speed_y = 0
player_one.update()
player_two.update()
cliff.draw()
player_one.draw()
player_two.draw()
player_one_bullet_list.update()
for player_one_bullet in player_one_bullet_list:
player_one_bullet.draw()
pygame.display.flip()
clock.tick(60)
#IGNORE THIS
#player_one_bullet_list = pygame.sprite.Group()
#elif event.key == pygame.K_SPACE:
# player_one_bullet = player_one_Bullet()
#
# player_one_bullet.ypos = player_one.ypos
# player_one.xpos = player_one.xpos
#
# player_one_bullet.speed_x = 14
#
# player_one_bullet_list.add(player_one_bullet)
#
#
#player_one_bullet_list.update()
#
# for player_one_bullet in player_one_bullet_list:
#
player_one_bullet.draw()
python pygame
I am trying to make a game where there are two players firing bullets at each other. One of my players that comes from a class blits onto the screen successfully. but the second player which is from another class which is virtually a clone of player ones class which has all the same functions. but somehow does not work:
import pygame
import random
import sys
pygame.init()
screen = pygame.display.set_mode((1280, 720))
clock = pygame.time.Clock() # A clock to limit the frame rate.
pygame.display.set_caption("this game")
class Background:
picture = pygame.image.load("C:/images/cliff.jpg").convert()
picture = pygame.transform.scale(picture, (1280, 720))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
def draw(self):
screen.blit(self.picture, (self.xpos, self.ypos))
class player_first:
picture = pygame.image.load("C:/aliens/ezgif.com-crop.gif")
picture = pygame.transform.scale(picture, (200, 200))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
self.speed_x = 0
self.speed_y = 0
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
self.ypos += self.speed_y
def draw(self): #left right
#screen.blit(pygame.transform.flip(self.picture, True, False), self.rect)
screen.blit(self.picture, (self.xpos, self.ypos))
class player_second:
picture = pygame.image.load("C:/aliens/Giantmechanicalcrab2.gif")
picture = pygame.transform.scale(picture, (200, 200))
def __init__(self, x, y):
self.xpos = x
self.ypos = y
self.speed_x = 0
self.speed_y = 0
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
self.ypos += self.speed_y
def draw(self): #left right
#screen.blit(pygame.transform.flip(self.picture, True, False), self.rect)
screen.blit(self.picture, (self.xpos, self.ypos))
class player_one_Bullet(pygame.sprite.Sprite):
picture = pygame.image.load("C:/aliens/giphy.gif").convert_alpha()
picture = pygame.transform.scale(picture, (100, 100))
def __init__(self):
self.xpos = 360
self.ypos = 360
self.speed_x = 0
super().__init__()
self.rect = self.picture.get_rect()
def update(self):
self.xpos += self.speed_x
def draw(self):
screen.blit(self.picture, (self.xpos, self.ypos))
#self.screen.blit(pygame.transform.flip(self.picture, False, True), self.rect)
def is_collided_with(self, sprite):
return self.rect.colliderect(sprite.rect)
player_one = player_first(0, 0)
player_two = player_second(1280, 0)
cliff = Background(0, 0)
player_one_bullet_list = pygame.sprite.Group()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_w:
player_one.speed_y = -5
elif event.key == pygame.K_s:
player_one.speed_y = 5
elif event.key == pygame.K_UP:
player_two.speed_y = -5
elif event.key == pygame.K_DOWN:
player_two.speed_y = 5
elif event.key == pygame.K_SPACE:
player_one_bullet = player_one_Bullet()
player_one_bullet.ypos = player_one.ypos
player_one_bullet.xpos = player_one.xpos
player_one_bullet.speed_x = 14
player_one_bullet_list.add(player_one_bullet)
elif event.type == pygame.KEYUP:
# Stop moving when the keys are released.
if event.key == pygame.K_s and player_one.speed_y > 0:
player_one.speed_y = 0
elif event.key == pygame.K_w and player_one.speed_y < 0:
player_one.speed_y = 0
elif event.key == pygame.K_DOWN and player_one.speed_y > 0:
player_two.speed_y = 0
elif event.key == pygame.K_UP and player_one.speed_y < 0:
player_two.speed_y = 0
player_one.update()
player_two.update()
cliff.draw()
player_one.draw()
player_two.draw()
player_one_bullet_list.update()
for player_one_bullet in player_one_bullet_list:
player_one_bullet.draw()
pygame.display.flip()
clock.tick(60)
#IGNORE THIS
#player_one_bullet_list = pygame.sprite.Group()
#elif event.key == pygame.K_SPACE:
# player_one_bullet = player_one_Bullet()
#
# player_one_bullet.ypos = player_one.ypos
# player_one.xpos = player_one.xpos
#
# player_one_bullet.speed_x = 14
#
# player_one_bullet_list.add(player_one_bullet)
#
#
#player_one_bullet_list.update()
#
# for player_one_bullet in player_one_bullet_list:
#
player_one_bullet.draw()
python pygame
python pygame
asked Nov 26 '18 at 17:39
user10632736
Would it work for you to post only the minimal amount of code that can reproduce this error? That way, those who can help you won't have to sort through lots of irrelevant stuff to find the issue. And you may even find the issue yourself when trying to reduce the code to the minimal example. Also it'd be good to include info on what you tried so far - for example, did you try a different image for player two to see if that was the problem? Also, are you sure the second player is in a position on the screen where they are expected to even be visible?
– Random Davis
Nov 26 '18 at 17:57
sorry the mistake was very obvious 😔
– user10632736
Nov 26 '18 at 18:34
Even so, you might want to add a self-answer to explain what the issue was, in case this question and your answer could help future readers.
– Random Davis
Nov 26 '18 at 18:36
the sprite was off screen
– user10632736
Nov 26 '18 at 18:37
add a comment |
Would it work for you to post only the minimal amount of code that can reproduce this error? That way, those who can help you won't have to sort through lots of irrelevant stuff to find the issue. And you may even find the issue yourself when trying to reduce the code to the minimal example. Also it'd be good to include info on what you tried so far - for example, did you try a different image for player two to see if that was the problem? Also, are you sure the second player is in a position on the screen where they are expected to even be visible?
– Random Davis
Nov 26 '18 at 17:57
sorry the mistake was very obvious 😔
– user10632736
Nov 26 '18 at 18:34
Even so, you might want to add a self-answer to explain what the issue was, in case this question and your answer could help future readers.
– Random Davis
Nov 26 '18 at 18:36
the sprite was off screen
– user10632736
Nov 26 '18 at 18:37
Would it work for you to post only the minimal amount of code that can reproduce this error? That way, those who can help you won't have to sort through lots of irrelevant stuff to find the issue. And you may even find the issue yourself when trying to reduce the code to the minimal example. Also it'd be good to include info on what you tried so far - for example, did you try a different image for player two to see if that was the problem? Also, are you sure the second player is in a position on the screen where they are expected to even be visible?
– Random Davis
Nov 26 '18 at 17:57
Would it work for you to post only the minimal amount of code that can reproduce this error? That way, those who can help you won't have to sort through lots of irrelevant stuff to find the issue. And you may even find the issue yourself when trying to reduce the code to the minimal example. Also it'd be good to include info on what you tried so far - for example, did you try a different image for player two to see if that was the problem? Also, are you sure the second player is in a position on the screen where they are expected to even be visible?
– Random Davis
Nov 26 '18 at 17:57
sorry the mistake was very obvious 😔
– user10632736
Nov 26 '18 at 18:34
sorry the mistake was very obvious 😔
– user10632736
Nov 26 '18 at 18:34
Even so, you might want to add a self-answer to explain what the issue was, in case this question and your answer could help future readers.
– Random Davis
Nov 26 '18 at 18:36
Even so, you might want to add a self-answer to explain what the issue was, in case this question and your answer could help future readers.
– Random Davis
Nov 26 '18 at 18:36
the sprite was off screen
– user10632736
Nov 26 '18 at 18:37
the sprite was off screen
– user10632736
Nov 26 '18 at 18:37
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53486360%2fpygame-sprite-not-blitting-onto-screen-when-used-draw-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53486360%2fpygame-sprite-not-blitting-onto-screen-when-used-draw-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Would it work for you to post only the minimal amount of code that can reproduce this error? That way, those who can help you won't have to sort through lots of irrelevant stuff to find the issue. And you may even find the issue yourself when trying to reduce the code to the minimal example. Also it'd be good to include info on what you tried so far - for example, did you try a different image for player two to see if that was the problem? Also, are you sure the second player is in a position on the screen where they are expected to even be visible?
– Random Davis
Nov 26 '18 at 17:57
sorry the mistake was very obvious 😔
– user10632736
Nov 26 '18 at 18:34
Even so, you might want to add a self-answer to explain what the issue was, in case this question and your answer could help future readers.
– Random Davis
Nov 26 '18 at 18:36
the sprite was off screen
– user10632736
Nov 26 '18 at 18:37