geralsoft

Members
  • Content Count

    8
  • Joined

  • Last visited

About geralsoft

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. function gcd(a, b) { if (b > a) { let _temp = a; a = b; b = _temp } while (b != 0) { let _m = a % b; a = b; b = _m; } return a; } function ratio(x, y) { let _c = gcd(x, y); return "" + (x / _c) + ":" + (y / _c) } class Utilidades{ //width = ancho //height = alto construct(){ } getAspect(){ aspect = ratio(window.innerWidth,window.innerHeight); console.log("que "+aspect); switch(aspect) { case '4:3': ancho=2048; alto=1536; //console.log(this.alto+" aa "+this.ancho); break;case '1:5': ancho=2048; alto=1536; //console.log(this.alto+" aa "+this.ancho); break; case '16:9': ancho=1920; alto=1080; console.log("bb"); break; default: ancho=1920; alto=960; console.log("ccc"); break; } anchoMid= ~~(ancho/2); altoMid= ~~(alto/2); console.log("width g "+ancho+" height g "+alto); } setDisplay(){ //dataRes.mode = false; let gameWidth = window.innerWidth; let gameHeight = window.innerHeight; let scaleToFitX = gameWidth/ancho ; let scaleToFitY = gameHeight/alto ; let currentScreenRatio = gameWidth / gameHeight; let optimalRatio = Math.min(scaleToFitX, scaleToFitY); if (currentScreenRatio >= 1.77 && currentScreenRatio <= 1.79) { canvas.style.width = gameWidth + "px"; canvas.style.height = gameHeight + "px"; canvas.style.left = ((gameWidth - (ancho * optimalRatio))/2)+"px"; canvas.style.top = ((gameHeight - (alto * optimalRatio))/2)+"px"; console.log("a "+canvas.style.left); }else { canvas.style.left = ((gameWidth - (ancho * optimalRatio))/2)+"px"; canvas.style.top = ((gameHeight - (alto * optimalRatio))/2)+"px"; canvas.style.width = ancho * optimalRatio + "px"; canvas.style.height = alto * optimalRatio + "px"; // console.log("b "+canvas.style.left); } scaleX = ancho/(gameWidth-(gameWidth-(ancho*optimalRatio))); scaleY = alto/(gameHeight-(gameHeight - (alto*optimalRatio))); //console.log("scale x "+scaleX+" scaley "+scaleY); console.log("width "+ancho+" height "+alto); dataRatio.offx = parseInt(canvas.offsetLeft); dataRatio.offy = parseInt(canvas.offsetTop); //if(jugando){ engine.resize(); }//fin de setDisplay setAspect(){ } }//end of class utils call util.getAspect(); on load, and setDisplay on resize event
  2. oh... well, the most complex game that I have made, not the most complex in the world, also has features that are not visible, such as automatic aspect ratio detection (4: 3, 16: 9, 18: 9, 19: 9); Multiple forms of control: keyboard / mouse, gamepad and touchpad. (you can play with any peripheral at any time in the gameplay) stereo sound particle system a creator of levels, (not published). multiple ads platform (admob, facebook ads and others) and.. without frameworks like pixi, phaser, some libraries to sound, bezier lines... Unfortunately, I'm not good at drawing, I hired a graphic designer but I didn't reach the budget, that's why I know about his graphic shortcomings, besides the requirement to finish the missions is not clear
  3. my most complex html5 game https://www.crazygames.com/game/space-jumper
  4. Hi, write me and maybe we can talk about this
  5. Typescript no es un marco, yo me iria con createJS
  6. Hi for all, share mi game in crazzygames, please playt it and tell me your opinion: https://www.crazygames.com/game/space-jumper
  7. Sent my videogame with rewarded videos, and they reject it because it doesn't show videos at any other time than from the "watch video" button 😩