games.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. $(document).ready(function() {
  2. // Init fancybox
  3. $('.fancybox').fancybox();
  4. var exampleName = [
  5. 'sample_arkanoid',
  6. 'sample_missile_commander',
  7. 'sample_gorilas',
  8. 'sample_snake',
  9. 'sample_asteroids',
  10. 'sample_asteroids_survival',
  11. 'sample_pang',
  12. 'sample_space_invaders',
  13. 'sample_floppy',
  14. 'sample_tetris',
  15. 'sample_gold_fever',
  16. 'sample_doom',
  17. 'game_raylib_features',
  18. 'game_drturtle',
  19. 'game_just_do',
  20. 'game_skully_escape',
  21. 'game_koala_seasons',
  22. 'game_light_my_ritual',
  23. 'user_raymario',
  24. 'user_crazyball',
  25. 'user_tictactoe',
  26. 'user_super_red_rope',
  27. 'user_taptojamp',
  28. 'user_funwithsat'];
  29. var exampleDesc = [
  30. 'arkanoid',
  31. 'missile commander',
  32. 'gorilas',
  33. 'snake',
  34. 'asteroids',
  35. 'asteroids survival',
  36. 'pang',
  37. 'space invaders',
  38. 'floppy',
  39. 'tetris',
  40. 'gold fever',
  41. 'doom',
  42. 'raylib Features DEMO',
  43. 'Dr Turtle & Mr Gamera',
  44. 'JUST DO',
  45. 'Skully Escape',
  46. 'Koala Seasons',
  47. 'LIGHT MY RITUAL',
  48. 'RayMario (Victor Fisac)',
  49. 'CrazyBall (Victor Fisac)',
  50. 'Tic-Tac-Toe (LelixSuper)',
  51. 'Super Red Rope Puzzles (Kurnic)',
  52. 'TapToJAmp (MarcMDE)',
  53. 'FunWithSATCollisions (MarcMDE)'];
  54. for (var i = 0; i < exampleName.length; i++)
  55. {
  56. var filterType = exampleName[i].substring(0, exampleName[i].indexOf("_"));
  57. var linkTag;
  58. if (filterType == 'sample') linkTag = '<a class="fancybox fancybox.iframe" href="games/loader.html?name=' + exampleName[i] + '" title="' + exampleDesc[i] + '">';
  59. else if (filterType == 'game') linkTag = '<a target="_blank" href="games/' + exampleName[i].substring(5) + '.html" title="' + exampleDesc[i] + '">';
  60. else if (filterType == 'user')
  61. {
  62. switch (exampleName[i])
  63. {
  64. case 'user_raymario': linkTag = '<a target="_blank" href="https://github.com/victorfisac/RayMario" title="' + exampleDesc[i] + '">'; break;
  65. case 'user_crazyball': linkTag = '<a target="_blank" href="https://github.com/victorfisac/CrazyBall" title="' + exampleDesc[i] + '">'; break;
  66. case 'user_tictactoe': linkTag = '<a target="_blank" href="https://github.com/LelixSuper/TicTacToe" title="' + exampleDesc[i] + '">'; break;
  67. case 'user_super_red_rope': linkTag = '<a target="_blank" href="https://kurnic.itch.io/super-red-rope-puzzles" title="' + exampleDesc[i] + '">'; break;
  68. case 'user_taptojamp': linkTag = '<a target="_blank" href="http://marcmde.github.io/TapToJAmp_v2_0/" title="' + exampleDesc[i] + '">'; break;
  69. case 'user_funwithsat': linkTag = '<a target="_blank" href="http://marcmde.github.io/FunWithSATCollisions_v_1_0_Browser/" title="' + exampleDesc[i] + '">'; break;
  70. default: break;
  71. }
  72. /*
  73. https://github.com/MarcMDE/TapToJump //http://marcmde.github.io/TapToJump_v1_0_Browser/
  74. https://github.com/MarcMDE/TapToJAmp //http://marcmde.github.io/TapToJAmp_v2_0/
  75. https://github.com/MarcMDE/FunWithSATCollisions //http://marcmde.github.io/FunWithSATCollisions_v_1_0_Browser/
  76. https://kurnic.wordpress.com/portfolio/flappy-jetpack/
  77. */
  78. }
  79. if (exampleName[i] == 'game_koala_seasons') linkTag = '<a target="_blank" href="http://www.koalaseasons.com" title="' + exampleDesc[i] + '">';
  80. $('#container').append(
  81. '<div class="mix f' + filterType + '">' + linkTag +
  82. '<img width="400" height="225" src="../games/img/' + exampleName[i] + '.png"><div class="extext"><p>' + exampleDesc[i] + '</p></div></a>' +
  83. '</div>');
  84. $('#container a .extext').hide();
  85. }
  86. // Instantiate MixItUp:
  87. $('#container').mixItUp();
  88. $("#container a").hover(
  89. function(){ $(this).find(".extext").show(); },
  90. function(){ $(this).find(".extext").hide(); });
  91. /*
  92. $("#container a img").hover(
  93. function() { $(this).stop().animate({ opacity:0.6 }, 200, "easeOutQuad" ); },
  94. function() { $(this).stop().animate({ opacity:0 }, 200, "easeOutQuad" ); }
  95. )
  96. */
  97. });