Skip to main content
nicholasl94949538
Participant
April 11, 2019
Question

How to change the ball in breakout game to a image?

  • April 11, 2019
  • 1 reply
  • 493 views

Hi guys, im working on a breakout game for an assignment at school. I have all the code done and my game works, now i'm just changing it up a bit and adding my own touch. I have been trying for the last couple days to change the moving ball to an image but i have been unsuccessful. If anyone has any idea please help me out.

this is the what we have been using to help us write the code.

2D breakout game using pure JavaScript - Game development | MDN

This topic has been closed for replies.

1 reply

HARSHIKA_VERMA
Community Manager
Community Manager
April 12, 2019

Hi nicholasl94949538,

As you are trying to replace the ball with an image in javascript, I would suggest you check this link:-

javascript - How do i add image to this canvas ball? - Stack Overflow

it looks like your issue is similar to the one described in this link above.

Could you please try the solution on the page and let us know if it helped?

Regards,

Harshika