Jump to content

Search the Community

Showing results for tags 'conquest'.

  • 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 1 result

  1. Hi there, im develong a game with ink. They are some planets and you shoot ink on them and then you conquer them. I use a temporal bitmapdata do draw render texture planets on it to use bitmapdata getpixel method to get if the planet is completely of a color (or almost). Im wondering if theres a better method because this is so laggy. Theres a way to get a pixel from renderTexture? conquer: function(p) { //I draw planet renderTexture on bmd bitmapdata to allow the getpixel function bmd.draw(p.capaPintura,0,0,(p.radio*2),(p.radio*2)); //Points of the planet to get pixels. col = []; col[0] = bmd.getPixelRGB(10,p.radio); //izquierda - centro col[1] = bmd.getPixelRGB(((p.radio*2)-10),p.radio); col[2] = bmd.getPixelRGB(p.radio,10); //centro - arriba col[3] = bmd.getPixelRGB(p.radio,((p.radio*2)-10)); if (col[0].rgba === col[1].rgba && col[2].rgba === col[0].rgba && col[0].rgba === col[3].rgba){ var c = 0; if(col[0].rgba === 'rgba(0,0,255,1)') c = 1; var colorPlanet = []; switch(c) { case 0: colorPlanet[0] = 0x550000; //Shadow color colorPlanet[1] = 0xAA0000; //Shadow color2 colorPlanet[2] = 0xFF0000; break; case 1: colorPlanet[0] = 0x000055; colorPlanet[1] = 0x0000AA; colorPlanet[2] = 0x0000FF; break; } //Shadow color pintData.beginFill(colorPlanet[0]); pintData.drawCircle(0, 0, p.radio*2); p.capaPintura.renderXY(pintData,p.radio,p.radio); //Shadow color 2 pintData.beginFill(colorPlanet[1]); pintData.drawCircle(0, 0, p.radio*2); p.capaPintura.renderXY(pintData,p.radio*1.1,p.radio*.9); //Planet color pintData.beginFill(colorPlanet[2]); pintData.drawCircle(0, 0, p.radio*2); pintData.endFill(); p.capaPintura.renderXY(pintData,p.radio*1.25,p.radio*0.75); } } Thats the code, i use it to check if the planet points (col[0], col[1], col[2] and col[3]) are of the same color, then if they are same color y draw on the planet renderTexture (p.capaPintura) colors of the conquerer ink. this is the planet after being conquerer by the blue team, the code works, but i have to use the conquer function once every time a planet is hit by ink or it wont work.. and its so laggy, theres a method to do it just with render textures?, i have to draw the planet renderTexture on bmd just to use getPixel, so if the planet is bigger then bigger is the lag i get because of that draw... .
×
×
  • Create New...