Skip to content

Instantly share code, notes, and snippets.

View formatt-c's full-sized avatar
😀

Matt formatt-c

😀
View GitHub Profile
@formatt-c
formatt-c / bitsy-google-analytics.md
Last active September 30, 2018 19:28
Add Google Analytics to your Bitsy game.

Google Analytics with Bitsy

It's very important to understand what's going on in your games and how players actually play your game. Here is a small writeup of how you can use Google Analytics event tracking with your Bitsy game. Since Bitsy is a very limited game engine this solution is hacky and maintainability is limited - but it works :D.

Setup

  1. Add a Google Analytics snippet to your exported game HTML file, refer to this link.

Note: The snippet should be placed near the top of the head section. Don't forget to enter your personal tracking ID of your analytics property.

How to solve audio problems with web games on itch.io

Browser: Google Chrome (Desktop and Mobile apps)

Starting with Chrome version 64, autoplay of audio has been disallowed in certain situations. As a result, web games on itch.io might be unable to play sounds. You can re-enable sounds in Chrome by doing the following:

  • Enter chrome://flags/#autoplay-policy in your URL bar.
  • Change the “Autoplay Policy” to "No user gesture is required".
  • Restart Chrome.
Link to raytracing example at gifboy.io
Adapted from lodev's and yonaba's raytracing tutorial
https://gifboy.io/--gifboy-wolfenstein%0A--based%20on%20lodev's%20and%20Yonaba's%20raycasting%20tutorial%0A%0Amap=%7B%0Awidth=10,%0Aheight=10,%0A%7B1,0,0,0,1,1,1,1,1,1%7D,%0A%7B1,0,0,0,0,0,0,0,0,1%7D,%0A%7B1,0,0,0,0,0,0,0,0,1%7D,%0A%7B1,0,0,0,0,0,0,0,0,1%7D,%0A%7B1,0,0,0,0,0,0,0,0,1%7D,%0A%7B1,0,0,0,1,0,0,0,0,1%7D,%0A%7B1,1,0,0,1,1,0,0,0,1%7D,%0A%7B1,0,0,0,1,0,0,0,0,1%7D,%0A%7B1,1,0,0,1,1,0,0,0,1%7D,%0A%7B1,1,1,1,1,1,1,2,2,1%7D%0A%7D%0A%0Aposx=1%0Aposy=3%0Adirx=1%0Adiry=0%0Aplanex=0%0Aplaney=0.66%0Arotation=math.pi/2%0Adirection=1%0Ascreenx=160%0Ascreeny=160%0AcolorRoof=6%0AcolorSky=5%0AcolorStripes=10%0A%0A--3D%20loop%0Adelay(150)%0Afor%20i=1,24%20do%0Aclear()%0Ax=0%0Afor%20x=0,screenx%20do%0Acamx=2*x/screenx-1%0Arayposx=posx%0Arayposy=posy%0Araydirx=dirx+planex*camx%0Araydiry=diry+planey*camx%0Amapx=rayposx%0Amapy=rayposy%0Asidedistx=0%0Asidedisty=0%0Adeltadistx=math.sqrt(1+(raydiry*raydiry)/(raydirx*raydirx))%0Ad
--direct link (copy-paste link in next line in your url bar, ignore rest)
https://gifboy.io/egg=%7B%7D%0Aegg%5B1%5D=%5B%5B%0A%20%20%20%20%20%20%200%200%0A%20%20%20%20%20%20%20000000%0A%20%20%20%20%200077777700%0A%20%20%20%20077777777770%0A%20%20%20%20077777777770%0A%20%20%2007777707770770%0A%20%20%2007777707770770%0A%20%200888776077706780%0A%20%200777877777777780%0A%20%200776887777777880%0A%20%200776888888888880%0A%20%200228888888888820%0A%20%200115555555555550%0A%20%2001555555555553BB0%0A%20%2001111100001533440%0A%20%20%2004BB0%20%20%20%20003440%0A%20%20%20%20000%20%20%20%20%20%20%20000%0A%5D%5D%0Aegg%5B2%5D=%5B%5B%0A%20%20%20%20%20%20%200%200%0A%20%20%20%20%20%20%20000000%0A%20%20%20%20%200077777700%0A%20%20%20%20077777777770%0A%20%20%20%20077777777770%0A%20%20%2007777707770770%0A%20%20%2007777707770770%0A%20%200888776077706780%0A%20%200888877777777780%0A%20077788877777778860%0A%20077788888888888860%0A%20077628888888888260%0A%20%200115555555555550%0A%20%200555555555555550%0A%20%20%2005555500111110%0A%20%20%