Jump to content

Search the Community

Showing results for tags 'Arrow'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 6 results

  1. Hello, I have a game with a larger than camera sized game world and I would like to display an arrow to an off screen sprite. I'd like the arrow to be pinned to the edge of the camera and of course rotate so the tip of the arrow points towards the sprite. Bonus if the arrow also disappears when the target sprite is in the bounds of the camera. Has anyone got any help on how to implement this?
  2. Hi, I noticed today while developping that when you press mac's cmd + directional arrow keyboard shortcut on a game where the arrow keys are binded, the command will repeat itself for a while (probably due to the original cmd + arrow function of moving the cursor to the end of the line), i first noticed it on my project, but it also happened on the website's examples as well. I dont know if this applies to window's ctrl + arrow as well, i haven't tested it yet. I did some research here on the forums and found nothing (perhaps i searched wrong), is this behavior normal? Is it possible to avoid it? (Other that not binding events to the arrow keys)
  3. Hi all, I am a beginner in Phaser and game programming. Now I need your help. I want to develop a game in a bow and arrow are used as a weapon Now I'm having trouble with the Physic of the arrow. Does anyone have an example for me how to program for the arrow should look. Thanks for your help
  4. Arrow Slider is my third html5 game. It is an original new puzzle game, kind of like a Rubik's cube except in 2D and maybe a little easier Tap on arrows to slide row or column in direction of arrow. The object of the game is to arrange the tiles like the goal layout. https://play.google.com/store/apps/details?id=com.bdrgames.arrowslider.ads
  5. Hi Im not sure if this is possible but for example if you hold the up and right arrow keys the player moves north east. Ive been trying to code this but just can't. Please Help Thanks.
  6. Hi. I'm trying to move my space jet so that way it is facing the left when I move the arrow key left, and it is facing right when I move the arrow key right. Any help would be greatly appreciated. Thanks. Here's my code in Javascript: var canvasBg = document.getElementById('canvasBg');var ctxBg = canvasBg.getContext('2d');var canvasJet = document.getElementById('canvasJet');var ctxJet = canvasJet.getContext('2d');var jet1;var gameWidth = canvasBg.width;var gameHeight = canvasBg.height; var fps = 10;var drawInterval;var imgSprite = new Image();imgSprite.src = 'sprite.png';imgSprite.addEventListener('load',init,false);//MAIN FUNCTIONSfunction init() { drawBg(); startDrawing(); jet1 = new Jet(); document.addEventListener('keydown',checkKeyDown,false); document.addEventListener('keyup',checkKeyUp,false);}function draw() { jet1.draw();}function startDrawing() { stopDrawing(); drawInterval = setInterval(draw,fps); }function stopDrawing() { clearInterval(drawInterval);}function drawBg() { var srcX = 0; var srcY = 0; var drawX = 0; var drawY = 0; ctxBg.drawImage(imgSprite,srcX,srcY,gameWidth,gameHeight,drawX,drawY,gameWidth,gameHeight); }function clearCtxBg() { ctxBg.clearRect(0,0,gameWidth,gameHeight); }//END OF MAIN FUNCTIONS//Jet functionsfunction Jet() { this.srcX = 0; this.srcY = 500; this.drawX = 200; this.drawY = 200; this.width = 100; this.height = 50; this.speed = 2; this.isUpKey = false; this.isRightKey = false; this.isDownKey = false; this.isLeftKey = false;}Jet.prototype.draw = function () { clearCtxJet(); this.checkKeys(); ctxJet.drawImage(imgSprite,this.srcX,this.srcY,this.width,this.height,this.drawX,this.drawY,this.width,this.height); };Jet.prototype.checkKeys = function () { if(this.isUpKey) { this.drawY -= this.speed; } if(this.isRightKey) { this.drawX += this.speed; } if(this.isDownKey) { this.drawY += this.speed; } if(this.isLeftKey) { this.drawX -= this.speed; }};function clearCtxJet() { ctxJet.clearRect(0,0,gameWidth,gameHeight); }//END JET FUNCTIONS//EVENT FUNCTIONSfunction checkKeyDown(e) { var keyID = e.keyCode || e.which; /// === mean exactly equal to /// || mean 'OR'. if (keyID === 38 || keyID === 87) { //38 means up arrow key and 87 means 'W' key. jet1.isUpKey = true; // prevent page from srcolling e.preventDefault(); } if (keyID === 39 || keyID === 68) { //38 means up arrow key and 87 means 'W' key. jet1.isRightKey = true; // prevent page from srcolling e.preventDefault(); } if (keyID === 40 || keyID === 83) { //38 means up arrow key and 87 means 'W' key. jet1.isDownKey = true; // prevent page from srcolling e.preventDefault(); } if (keyID === 37 || keyID === 65) { //let arrow or A key jet1.isLeftKey = true; // prevent page from srcolling e.preventDefault(); }}function checkKeyUp(e) { var keyID = e.keyCode || e.which; /// === mean exactly equal to /// || mean 'OR'. if (keyID === 38 || keyID === 87) { //38 means up arrow key and 87 means 'W' key. jet1.isUpKey = false; // prevent page from srcolling e.preventDefault(); } if (keyID === 39 || keyID === 68) { //38 means up arrow key and 87 means 'W' key. jet1.isRightKey = false; // prevent page from srcolling e.preventDefault(); } if (keyID === 40 || keyID === 83) { //38 means up arrow key and 87 means 'W' key. jet1.isDownKey = false; // prevent page from srcolling e.preventDefault(); } if (keyID === 37 || keyID === 65) { //let arrow or A key jet1.isLeftKey = false; // prevent page from srcolling e.preventDefault(); }}//END OF EVENT FUNCTIONS
×
×
  • Create New...