spinnerbox

Members
  • Content count

    279
  • Joined

  • Last visited

About spinnerbox

  • Rank
    Advanced Member
  • Birthday 12/31/1986

Contact Methods

  • Website URL
    http://spinnerbox.blogspot.com
  • Twitter
    spinnerbox

Profile Information

  • Gender
    Male
  • Location
    Macedonia, Skopje
  • Interests
    Game desgin and development. My other R&D blog: http://tunephp.blogspot.com

Recent Profile Visitors

1,056 profile views
  1. I will be adopted by Chuck Norris Great, its fun! Maybe a health bar would look nicely when beating someone. You could also add achievements. But how do I pause it? Does Phaser pauses it when out of focus?
  2. Which one of these is Yoyo? http://sole.github.io/tween.js/examples/03_graphs.html
  3. I don't think tweens are designed to be fiddled like timers. It just starts and works until it reaches the end state. You can pause it but cannot reset it. Recreate the tween with same settings, to reset it from start, maybe? You could also play with timers and set properties of game objects with timers. But I don't know how Yoyo curve looks like Set a value for a game object property calculated by Yoyo function at a given time. Since it will be a timer, you can stop, pause, reset, loop...
  4. https://phaser.io/examples/v2/category/tweens https://phaser.io/examples/v2/tweens/pause-tween https://phaser.io/examples/v2/tweens/yoyo Also consult the Tween API You can add events onStart, onComplete, onRepeat, onLoop
  5. canvas is just a tag in the DOM. window is the parent element of all other elements in the DOM. You can draw fast graphics in canvas. You could also do some drawing with CSS and HTML, but the DOM is very slow. So there is the difference. That is why Phaser works in canvas, not in the DOM.
  6. The admob plugin loads something(ad image) or it just hangs? Explain more please. And by the way, admob is an Android plugin or you include it in javascript? Share some link, which plugin is that you use.
  7. Would really like to know Firebase, but I don't. The first thing you do when you use new technology is to read the docs: https://firebase.google.com/docs/web/setup https://firebase.google.com/docs/samples/#web
  8. JSON file is just a pile of data, no code there. localStorage is the web API that enables you to save data locally that will last after you close the browser. But it is easy to delete it, just call window.localStorage.clear(); You need JavaScript code and you include it in index.html <!DOCTYPE html> <html> <head> <title>Game Name</title> <meta charset="UTF-8" /> <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove this if you use the .htaccess --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="description" content=""> <meta name="author" content="author"> <meta name="viewport" content="width=device-width, height=device-height, maximum-scale=1, initial-scale=1, user-scalable=no"> <!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references --> <link rel="shortcut icon" href="assets/images/favicon.ico"> <link rel="apple-touch-icon" href="assets/images/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon-16x16.png"> <link rel="stylesheet" href="css/style.css"> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <style> body { margin: 0; padding: 0; } </style> </head> <body> <!-- libraries --> <script src="js/phaser.min.js"></script> <script src="js/jquery.min.js"></script> <!-- main file and utility --> <script src="js/MainFile.js"></script> <script src="js/utils/Utility.js"></script> <!-- constants --> <script src="js/Constants/Graphics.js"></script> <script src="js/Constants/GameMessages.js"></script> <script src="js/Constants/GameErrors.js"></script> <script src="js/Constants/Constants.js"></script> <script src="js/Constants/GameSettings.js"></script> <!-- data --> <script src="js/GameData/GameData.js"></script> <script src="js/GameData/OptionsData.js"></script> <!-- states --> <script src="js/States/State.js"></script> <script src="js/States/Boot.js"></script> <!-- UI --> <script src="js/UI/ArtmButton.js"></script> <script src="js/UI/GoToScreen.js"></script> <script src="js/UI/GoToUrl.js"></script> <!-- screens --> <script src="js/Screens/Screen.js"></script> <script src="js/Screens/Preloader.js"></script> <script src="js/Screens/MainMenuScreen.js"></script> <script src="js/Screens/StatsScreen.js"></script> <script src="js/Screens/OptionsScreen.js"></script> </body> </html> But this is while developing. You should have only one file, something like MainFile.min.js which will hold all other files, minified. You can use Nodejs, Grunt and Uglify to minimize the js file automatically.
  9. Don't use the "window" keyword, its reserved for the DOM of your web site/application. Name it somehing like "gameWindow". I also don't think dynamically generating keys in JavaScript object literal will work. The object does not exist yet at the time when you create your key. Unless this is ES6? Can you do this in ES6?
  10. I created my own template to enable separation of concerns, in different files. Check this GitHub project I use namespace() function to put all functionality under one DOM node, so it doesn't mix with other code in the DOM namespace. Therefore I have two files State.js and Screen.js. Boot inherits from State and all other screens(scenes) inherit from Screen. I also make utility classes like Utility.js where I put useful functions, so they don't mix with the other game logic or graphics code.
  11. Not sure what lopsided means. But if the thinner border on top and right is your problem, maybe you have gave Phaser wrong size parameters when importing the image asset that holds the square. Make sure the dimensions are pixel perfect and you know exactly where the image should be cut(blitted) by Phaser.
  12. When I load my main menu screen(Phaser.State) game.sound is already initialized. So in init() of MainMenuScreen I can now set game.sound.mute = true; //false But still a good to know fact. If somebody knows when exactly it gets created, please share.
  13. When the first Phaser.State gets created?
  14. I create new game object with var game = new Phaser.Game(STAGE_WIDTH, STAGE_HEIGHT, phaser.AUTO, HTML_CONTAINER); and right after this line I call to set game.sound.mute = true/false depending on the saved value in window.localStorage. But the problem is, when I console.dir(game), it prints the structure of the Phaser game object but game.sound is still null, so I cannot set the sound to muted or unmuted at that moment. When does game.sound sub-object gets created?
  15. Why do you call "new" to a function? Just use it Fish(params) with no "new". And by the way you create die() function to the prototype of a function. Not sure what are you trying to achieve? And the error says, no property 'eatSound' in superThis. What do you send as argument for superThis in makeFish() function? What scope, scope of what? JS ES5 has only function scope and variable hoisting(all variables are stuck at the top of the function.) And where do you call die() ?