Search the Community

Showing results for tags 'javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 484 results

  1. I've been working on a new type of word game called 'Redact' which involves removing letters from a sentence to reveal a hidden word. Find the game here: http://www.redact.online I went for a minimalist design with this as I felt it complemented the simplicity of the gameplay. Its designed to be played on a desktop/laptop computer, but working on mobile support! Instructions can be found by clicking the question mark in the top left. Let me know what you think!
  2. spacegame

    My latest game. Built with phaser from a tutorial. I then built on the tutorial by adding access to the localstorage api. Here is the link Positive criticism is much appreciated as well as tips for improvements Thanks Pheaset
  3. localstorage

    hey guys I'm currently after completing a tutorial at http://zenva.com . I have been working on my knowledge with phaser. anyways, after finishing the tutorial i decided to polish the game. I am new to the localstorage api and was looking for some help. here is my code for the highscore. it currenly doesnt work with localstorage and im not sure why. Any help is much appreciated init: function(score) { var score = score || 0; localStorage.setItem("score", this.highestScore); this.highestScore = this.highestScore = localStorage.getItem("score"); this.highestScore = Math.max(score, this.highestScore); if(this.highestScore === null) { localStorage.setItem("score", "0") this.highestScore = localStorage.getItem("score"); } }, Here is the full file. Just incase its needed var SpaceHipster = SpaceHipster || {}; //title screen SpaceHipster.MainMenu = function(){}; SpaceHipster.MainMenu.prototype = { init: function(score) { var score = score || 0; localStorage.setItem("score", this.highestScore); this.highestScore = this.highestScore = localStorage.getItem("score"); this.highestScore = Math.max(score, this.highestScore); if(this.highestScore === null) { localStorage.setItem("score", "0") this.highestScore = localStorage.getItem("score"); } }, create: function() { //show the space tile, repeated this.background = this.game.add.tileSprite(0, 0, this.game.width, this.game.height, 'space'); //give it speed in x this.background.autoScroll(0, 10); //start game text var text = "Tap to begin"; var style = { font: "30px Arial", fill: "#fff", align: "center" }; var t = this.game.add.text(this.game.width/2, this.game.height/2, text, style); t.anchor.set(0.5); //highest score text = "Highest score: "+this.highestScore; style = { font: "15px Arial", fill: "#fff", align: "center" }; var h = this.game.add.text(this.game.width/2, this.game.height/2 + 50, text, style); h.anchor.set(0.5); }, update: function() { if(this.game.input.activePointer.justPressed()) { this.game.state.start('Game'); } } };
  4. Hello boys and girls! Is it possible to access local files, images in particular, upload them, and use in the game as a sprite? For example, player clicks a button, opens up a file dialog, chooses an images and uploads it. Later that image is going to used a background or something like that.
  5. Hey I am currently polishing off my Breakout or Brick-Breaker game (whichever you prefer to call it). I am trying to add music to the game when the start button is pressed and then sound effects every time a brick is destroyed. Unfortunately Phaser keeps saying Key "Sample" is not found in cache. I have tried using Phasers examples and basing the music off that but to no avail. I am new to programming with Phaser and would really appreciate the help. When the game is finished i will post a link. Thanks in Advance Pheaset here is my code var game = new Phaser.Game(480, 320, Phaser.AUTO, null, { preload: preload, create: create, update: update }); var firework;; var music = Phaser.Sound; var lives = 1; var livesText; var lifeLostText; var ball; var paddle; var bricks; var newBrick; var brickInfo; var scoreText; var score = 0; var playing = false; var startButton; function preload() { game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; game.stage.backgroundColor = '#eee'; game.load.image('ball', 'ball.png'); game.load.image('paddle','paddle.png'); game.load.image('brick', 'img/brick.png') game.load.spritesheet('ball', 'img/wobble.png', 20, 20); game.load.spritesheet('button','button.png', 120, 40); game.load.audio('Good-Riddance', 'Good-Riddance.mp3'); } function create() { game.physics.startSystem(Phaser.Physics.ARCADE); startButton = game.add.button(game.world.width*0.5, game.world.height*0.5, 'button', startGame, this, 1, 0, 2); startButton.anchor.set(0.5); music = game.add.audio('Good-Riddance') this.music = this.add.audio("Good-Riddance") this.game.sound.setDecodedCallback(["Good-Riddance"]); if(playing === true) { music.play() }else{ music.mute = false; }
  6. I'm having problems transferring sprite from another sprite to stage and then back to another sprite. The scenario is I have two rotating sprites (wheels) and another sprite (player). Initially, the player is added to wheelA as a child. Upon pressing fire, the player is removed from wheelA and its velocity is changed so that it moves away from wheelA. (Player is removed from wheelA so that it ignores wheelA's rotation). The player is also added to the game via game.add.existing(player); (Since it doesn't render after removing from wheelA). On update, I check if player overlaps with wheelB. On overlap, I disable the physics of the player and add it as child of wheelB. The result is player is not rendered on the scene although it is a child of wheelB.
  7. phaser.io

    Hey guys, I am fairly new to the Phaser.io game engine and so far I like it. I am making a game and have ran into some issues maybe you guys can help me or even show me some examples. Right now my goal is to make a screen box. So when an object interacts with another object a question box pops up and it has a question with buttons that represent possible answers. I am stuck on the making a box pop up with it happens. Any help is appreciated, -Fellow Dev
  8. Hello people! I ran into when issue when I was developing my new game. It is a game where arrows show up on the screen and you have to swipe in the direction that the top arrow is pointing to. You have to swipe when the arrow is within a certain area on the screen (check the screenshot), represented by a faded arrow in the circle. That arrow in the circle rotates to the direction that the closes moving arrow is pointing to. I use tween for the rotation animation. Here is the problem. When the arrow in the circle is pointed to the left (angle = -180) and the incoming arrow point down (angle = 90), the arrow in the circle is animated clockwise, meaning it goes through top, right and then finally down, not straight down as I want. I have set up an if statement to switch arrow's in the circle angle to 180, but it does not work. Changing it to 179 works as expected. Why can't I change it to 180 in the first place?
  9. Hello, I have a big js code. I am interesting to create flowchart of my code. Can you should me a software, free or not, to write js code. i am testing : http://www.flowgorithm.org
  10. Hi everyone! I am currently working on a game where a player has to avoid walls that spawn on the top of the screen. I have a sprite that is a three-line road. Player can step on only one line at a time. I want the background sprite (the road) to auto scroll from top to bottom. At the same time I want it to spread across the entire screen width. To I basically want a single sprite to have the width of the screen and tile vertically. Is it possible to achieve such a thing in Phaser?
  11. Hi everyone... I'm making a simple HTML5/JS program I plan to integrate into an existing game I have that is supposed to load an explosion sprite from a sprite sheet I created (375px by 25px, each individual sprite is 25px by 25px, 15 sprites total) onto the HTML canvas. It is not yet animated, as I haven't been able to make it actually show up (this is my problem) I'll leave the code below, if you see what's causing the problem, please leave a reply with a suggestion on how to fix (that would be really helpful as I have been making zero progress in the past hour). Thanks in advance! If it helps, I have been using code from this tutorial here: http://www.williammalone.com/articles/create-html5-canvas-javascript-sprite-animation/ <html> <body> <canvas id="exploder"></canvas> <script> var canvas = document.getElementById("exploder"); canvas.width = 25; canvas.height = 25; var explosionImage = new Image(); explosionImage.src = "ExplosionFinal.png"; var explosion = sprite({ context: canvas.getContext("2d"), width: 25, height: 25, image: explosionImage }); function sprite(options) { var that = {}; that.context = options.context; that.width = options.width; that.height = options.height; that.image = options.image; that.render = function() { // Draw the animation that.context.drawImage( that.image, 0, 0, that.width, that.height, 0, 0, that.width, that.height); }; return that; } explosion.render(); </script> </body> </html> And when I run this in Chrome nothing is showing up in the canvas element. As far as I can tell it isn't an error with sourcing the file as when I hover over this statement here: explosionImage.src = "ExplosionFinal.png"; my text editor shows a preview of the file, with the sprite sheet showing.
  12. Hi all! Lucky Kat is an award winning mobile-first game studio based in the Netherlands. We have a mission to deliver fun game experiences with a pop-culture twist. We are the creators of mobile hits such as Nom Cat, Sky Chasers, Combo Critters and Grumpy Cat's Worst Game Ever. Our games have been featured worldwide by Apple and Google. Be at the heart of Lucky Kat’s development process creating fun and engaging (mobile) game experiences to users all around the world. We use our own proprietary game engine “Bento” which is based on HTML5 /JavaScript. As a Game Developer you will be dedicated to build games from beginning (prototyping) to the end (launch), while working together with artists and product managers. You create high quality and high performance code, and have a passion for game design. Delivering an outstanding user experience is your top priority. For more info, please go to: http://www.lucky-kat.com/gamedeveloper or send your CV and portfolio to jobs[at]lucky-kat.com
  13. Dear readers, I want to ask a question about Phaser, if my enemy gets killed I want to start a blood animations (spritesheet) , I tried to put it in my collisionHandler where my bullet and enemy die but this doesn't work. On phaser itself I found emitters but i'm not great with that, so if someone could help me understand the logic that would be great Thanks, Yupoong
  14. Hi, i wonder if the babylon have some function that creates a GIF for download. If this not exist, Is it possible to do with JS ?
  15. Hello all I am making an shooting game in phaser I want to control the gun using the arrow keys i,e [upArrow,DownArrow and enter] upArrow : is to increase the angle downArrow : is to decrease the angle Enter : To hit the target I do no this thing how to do any help guys Thanks
  16. Hello guys I'm working on a javascript game, some times I need to call a function 2, 3 or X seconds after an action, the question is. What is better in performance, create multiple setTimeout() or use the main loop to evaluate a function queue? thanks
  17. My first HTML5 Game, Snaked.io (So exciting! ) Every since playing the famous revolutionary agar.io game, I was inspired to create my own "io" game, so here it is! I took the classic version of Snake, and made it multiplayer Snaked.io (Server may take a while to connect, and a bit laggy due to it being free from Heroku) Basically, what I want to know is (preferably 1-10 scale): Do you like the concept? How easy was it to understand how to play? What would you add/change? Any bugs? (For now, may experience lag) What do you think of the name of the game? Anything else that comes into mind, please add! Gameplay Objective of the game is to eat the gray squares causing you to extend your length, while avoiding crashing into yourself, or others. Become the longest of them all! Controls W or ^ - Up S or v - Down A or < - Left D or > - Right Enter - Chat Hope you enjoy this as much as I did making it! SCREENSHOTS Screenshot (1) Screenshot (2)
  18. Hey everyone so I started my venture into programming months ago and started out with game maker language but didn't think I would ever get a job writing games in GML and so I stopped learning it and started learning HTML CSS and just recently 3 months or so ago got into what I thought would be super scary JavaScript, I dabbled in all the languages I could tbh and they all seemed so daunting. I didn't know what to do so I went back to HTML, CSS and JS. I think I understand JavaScript at a beginner level. My question how ever is.Is trying to study HTML5 game development as a sole hope to get a job doing it viable? I mean I can sit here and learn more on making websites but its not really my interest at all. I love games, playing em coming up with ideas to make em all of it. I would of learned Unity or Unreal but C# and C++ seemed so confusing to me, I like how JavaScript writes it just makes sense to me. But then when I start to make games and I've made some with tutorials with the Phase framework. I just get confused if I try to do it on my own. With Phaser I've done many many tutorials but I still can't seem to set out and just write it on my own. I just want to be able to one day make a game and have some kid stumble upon a kick ass browser game like I did years ago when I saw my neighbor playing Tibia and later RuneScape and thought it was the coolest thing ever. I know that RuneScape was originally written in Java and now C++, and Tibia was always a downloaded game idk what language it was written int but it does have a browser option now and I think thats amazing. Great games accessible anywhere with no download. Sources I've used to make games with Phaser Zenva Academy Interphase From Null to Full Lessmilks 2d Platformer Lessmilks Flappy Bird And I've even learned to just make games on the canvas with these 2 sources (no game engine.) GameKedo Intro to Canvas GameKedo Follow Up to beginner course Basically What I'm asking is if I should continue down this route and try to flesh out my skills and get a job for game development and what other sources or routes can I take to get there?
  19. "Bushed Bricks" it's simple and fun game on JavaScript. The rules of the game are simple. You need to combine blocks of the same color. When a block reaches x4 (default by desktop), you can move it to the line similar color. You'll get game points for that. To win, you need on hold 400 steps or earn 5000 points. To controls use navigation keys (← ↑↓→) for desktop or swipe for tablet/mobile Play it here: https://shtange.github.io/bushed-bricks/ Source code: https://github.com/shtange/bushed-bricks On desktop it looks like this: On mobile devices: I'll be glad to hear your opinion about my game.
  20. I have developed so many games in Phaser but it is lagging and performance is too bad. I am really having no way to improve the performance. http://slopho.southindia.cloudapp.azure.com/static/games/homerun/index.html Thanks, Awadh
  21. Hello readers and helpers, I am working quite a lot on my game but I struggle with some things like: 1) I spawn my enemies in 5rows from the top to the bottom and they also walk down already. My problem is that they spawn with 5 and go down with 5 at the same time, I want that the enemies spawn at a different time (random time) The code that I used to spawn 5enemies in a row at the top and let them walk down. for (var i =0 ;i < 800 / 40 ;i++) { var sprite= game.add.sprite(20 + (i * 170), 32,"enemysheet"); sprite.scale.setTo(3); enemies.add(sprite); var walk = sprite.animations.add('walk'); sprite.animations.play('walk', 20, true); sprite.body.velocity.y = 100; } 2) My second problem is that when 5 enemies are killed that I want to go to a new level where more enemies will come. But how do i do this? (With new states with all my code and changes for the more enemies ?) ---> This doesn't look clean I think ----------------------------------------------------------------------------------------------------------------------------------------- Thank you for helping in advance guys, I appreciate it.
  22. Hi all... I'm programming a simple JS canvas game and I have a couple questions about two bugs I have noticed. I'll attach the game's code so you can play it and see visually what I am talking about. The first bug, which you will definitely notice when you start moving around (use arrow keys), is that the player (green square) seems sort of fuzzy/compressed on the side that is on the direction they are travelling. This one I have absolutely no idea as to what is causing it, but it doesn't seem to happen on the enemies. If anyone has any ideas about what's causing that or how to fix it that I would love to know. The second one happens when you shoot (use WASD keys) while moving. The rocket (blue square - my graphics are stunning) seems to make a curved triangle sort of shape (sort of hard to describe), like it is accounting for the movement of the player and when it exits the canvas it seems to be fully corrected as far as I can tell. I want it to instead shoot straight while my player continues onward in the direction they are going. If anyone can tell me what is causing these bugs and/or how to fix it that would be great! Thanks. The files: run.html game.js
  23. Hi everyone! I'm a first time poster on this forum after having just come across it after a google search - just what I was looking for. I have a finance background but have been learning how to program (JavaScript) the past few months. I have an idea for a simple game that I really want to build. However, instead of learning Swift, I was thinking of building a native iOS app using something like PhoneGap or CoCoon. I don't even know if that's actually possible since I don't know what exactly they are but from what I've gathered, these programs will let you build a game in JavaScript and compile it into a native iOS app - which would be pretty cool! Can someone guide me to some resources on where I can get introduced to the world of making games using JavaScript for iOS (where I think the market for games really is)? Thank you - looking forward to contributing to this community!
  24. Job posting: Studio FOW Position: Senior Game Software Developer We are looking for a game senior game software developer who can deliver web based, HTML5 game applications. The role includes overseeing the full development life cycle including identifying the correct technology, architecting the application, security, testing and deploying. This is not a project management role, you will be solely responsible for implementation. The candidate must have a proven track record in developing web based game applications using WebGL and JavaScript. We expect the developer to be able to deliver a modular, scalable and testable application. You will also be working to integrate existing pre-rendered video content into the game which forms an integral part of the player experience. Experience in enterprise grade applications would be necessary so the design could address high availability requirements (i.e. load balancing and clustering). Experience in WebSockets and relational databases such as MySQL, PostgreSQL or MS SQL are required. Experience in ECMAScript, NodeJS and node-webkit would be a plus. Knowledge of other programming languages (Python, C++) is also a plus. Please note that this game will be of the adult (18+) variety and therefore anyone uncomfortable with such content need not apply. A portfolio and references will be required during the interview process.
  25. Dear readers, I have a problem, well not a problem, but I need help. At first I want to say that English is not my main language and if I make mistakes you should correct me. I'm also new to phaser and programming, but I am willing to learn. So for school i need to make a game linked with a database (login, score, money) on a website. What I was thinking is some kind of Plants VS Zombies, but then with 1shooter at the bottom, move him sideways to kill the zombies and try to keep them away from the under border. What I have already is the background, the moving "soldier" and that he can shoot. I also have an enemy sprite but for some way he doesn't want to load ... . I don't know how to spawn the enemies in like 5 /6 lines from top. And that they will walk down, like LEVEL1: kill 5 zombies LEVEL2: kill 10 , and each level you earn money for more damage, but the zombies will become better and better. So it would be a great help if somebody could explain this for me, not only in code but also in words, like I said i'm new in coding and want to learn. In the attachment you will find a zip of my game, my main language is DUTCH, so the commentaries are in DUTCH, but my code is in English. If i need to explain something i wrote, just ask :)! Thanks for everyone who wants to help! I'll try to answer as soon as possible ! STAY CODING AND LEARNING !! PhaserCode.rar