Added: 5 months ago
From: markjsb7
Views: 527
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (3)

Sign In or Sign Up now to post a comment!
  • Could you explain the use/reasoning behind the "|" in the following lines (I couldn't find anything on Google. Mainly cause I did not know what to look for):

    bitmap.regX = bitmap.image.width/2|0;

    bitmap.regY = bitmap.image.height/2|0;

    ship.y = canvas.height*Math.random()|0

    Thanks!!! I am enjoying going through your video tutorials. Very Helpful!

  • @rockindahizzy its the equivelant of

    bitmap.regX = Math.floor(bitmap.image.width/­2);

    the reason to use |0 instead is because it runs faster

  • @VeryAngryBeaver

    OH!!

    That makes sense. Thanks for the help!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more