HTML5 sprites seemed to be swapped

Discussion in 'Programming' started by Uhfgood, Jan 3, 2017.

Tags:
  1. Uhfgood

    Uhfgood Member

    Joined:
    Sep 26, 2016
    Posts:
    87
    I have a bare-bones app (will be a breakout clone) that seems to swap two sprite graphics. I created a sprite for the walls in my breakout clone, and then the paddle is it's own sprite as well. If I run it in windows or on my LG phone (android) it looks fine... (I stretch out the top and side walls), but when I run it for html5 the paddle gets stretched and put on the top, and the top wall graphic gets put down where the paddle should be.

    I have no idea why it would be swapped. Ideas? I'm using some code to scale my 135x240 screen to the height of the display, so it may like in there some where.
     
  2. Uhfgood

    Uhfgood Member

    Joined:
    Sep 26, 2016
    Posts:
    87
    Here's an image to show you what I mean:

    WinVsHtml5_BreakBit.png

    The windows version is on the left (The android version also outputs properly), the html5 is on the right, notice the paddle is on top and the little box with "T" in it is on the botom.

    Not really sure why it would be doing this.
     
  3. Mishtiff

    Mishtiff Guest

    Create a new sprite for your paddle colored red. Go into your code and change the sprite for your paddle to the new sprite. See if the same effect happens, or if it somehow changes it to blue again. If that is the case, that means somewhere in your code you have coded it to do so. Let me know what happens.
     
  4. Uhfgood

    Uhfgood Member

    Joined:
    Sep 26, 2016
    Posts:
    87
    Quick question, how in the world did that fix it?

    in fact even the top sprite is correct now

    I bet it needed a clean build, huh?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice