Uhfgood

Members
  • Content Count

    47
  • Joined

  • Last visited

About Uhfgood

  • Rank
    Advanced Member

Contact Methods

  • Twitter
    Uhfgood
  1. When is the original Unreal going to get a remake?

  2. https://dl.dropboxusercontent.com/u/32895233/sroids/index.html -- this is the game itself Here is a zip of the project folder (essentially what's above but in a way that allows you to look at the source more easily) https://dl.dropboxusercontent.com/u/32895233/sroids.zip
  3. Interesting. Currently my code right now just uses the scale.x and scale.y members to scale down, and whenever it does (it has to do this multiple times, 9 sprites for one asteroid, and 5-15 asteroids), it drops the framerate a bit. Not a lot but it's noticeable enough that I figure it would chug on a mobile browser (which I haven't tested this with yet). My only other option was to create 3 separate sprite sheets for each size. So that's why I asked about prescaling. In fact your above code is just what I needed. I didn't know you could add a spritesheet to the cache manually. In any case thanks.
  4. So I already asked about prescaling sprites, and I got a suggestion to use bitmap data, however all my attempts didn't work. So I'm going to clarify. I want to take an image I use as a sprite sheet for my asteroids, and then I want to shrink that down twice (50%, 25%), then I want to use the two smaller images as spritesheets. Scaling them in-game causes a small performance hit vs just creating the sheets in a paint-program. So basically I want phaser to scale the image down twice, then use the resulting images as spritesheets for my asteroids. Is there a way to do this with bitmap data or whatever?
  5. There's not a big visible change -- there's a lot that's been refactored 'under the hood' so-to-speak. I've changed the way I do asteroids, and have changed the graphics a bit. Let me know if it gets horrendously slow. However before deciding something is wrong with the game, make sure to close everything and restart (even a computer reboot if it's not too much trouble). Some people just assume it's the game when half the time it's any number of things, cache being full, multiple open tabs, a lot of cpu intensive stuff, type of browser and os. There's just a bajillion things that could cause the slow down. That being said, I have experienced a bit of a slow down when you destroy asteroids, has to do with scaling the asteroids in-game instead of pre-scaling them. Let me know. CLICK IMAGE TO PLAY:
  6. So the other way around, I guess I misread it (but I did read it). Okay, I'll figure this out yet.
  7. Okay so i have another problem... it works, but, the explosion is still the same size -- I thought if I made the bmd size smaller, that load would scale it down to fit -- is this not the case, do I need some other copy function?
  8. Well I was trying to do this for constancy... but thanks, I will go ahead and do that.
  9. Thanks, I just did that, now I'm trying to do something else -- I want to use the bmd image as a texture -- and what I did was try to set the bmd.key to what I wanted to use -- is there a way I can do this? here's the updated preloader; Sroids.Preloader = function( game ) { Sroids.GAME_WIDTH = 800; Sroids.GAME_HEIGHT = 600;};Sroids.Preloader.prototype ={ preload: function() { this.preloadBar = this.add.sprite( ( Sroids.GAME_WIDTH - 720 ) / 2, ( Sroids.GAME_HEIGHT-32 ) / 2, 'preloaderBar' ); this.load.setPreloadSprite( this.preloadBar ); this.game.load.image( 'splash', 'gfx/splash_square.png' ); this.game.load.spritesheet( 'explosion', 'gfx/explode.png', 64, 64 ); this.game.load.spritesheet('ship', 'gfx/ship.png', 32, 32); this.game.load.image('bullet', 'gfx/bullet.png'); // load asteroid graphics this.game.load.spritesheet( 'ast_yellow', 'gfx/ast_yellow.png', 64, 64 ); this.game.load.spritesheet( 'ast_red', 'gfx/ast_red.png', 64, 64 ); this.game.load.spritesheet( 'ast_green', 'gfx/ast_green.png', 64, 64 ); this.game.load.spritesheet( 'ast_blue', 'gfx/ast_blue.png', 64, 64 ); this.game.load.spritesheet( 'ast_gray', 'gfx/ast_gray.png', 64, 64 ); this.game.load.image( 'explode_large', 'gfx/explosion.png' ); }, create: function() { var bmd_med = this.game.make.bitmapData( 32, 32 ); bmd_med.load( 'explode_large' ); bmd_med.key = 'explode_medium'; var bmd_sml = this.game.make.bitmapData( 16, 16 ); bmd_sml.load( 'explode_large' ); bmd_sml.key = 'explode_small'; this.state.start( 'Game' ); }};Basically I want to call load texture whenever I want the medium and small images with a string -- is this possible? Here's where I tried to use it: // explode just sets up an explosion graphic explode: function( lifespan ) { for( var i = 0; i < this.NUM_CLONES; i++ ) { var explosion = this.explosions[ i ]; if( explosion != null ) { explosion.x = this.clones[ i ].x; explosion.y = this.clones[ i ].y; if( this.size === 'large' ) explosion.loadTexture( 'explode_large' ); else if( this.size === 'medium' ) explosion.loadTexture( 'explode_medium' ); else if( this.size === 'small' ) explosion.loadTexture( 'explode_small' ); explosion.lifespan = lifespan; explosion.revive(); } } },
  10. I'm using this example as my basis - http://examples.phaser.io/_site/view_full.html?d=bitmapdata&f=set+hsl.js&t=set%20hsl This code is in my preloader: Sroids.Preloader = function( game ) { Sroids.GAME_WIDTH = 800; Sroids.GAME_HEIGHT = 600;};Sroids.Preloader.prototype ={ preload: function() { this.preloadBar = this.add.sprite( ( Sroids.GAME_WIDTH - 720 ) / 2, ( Sroids.GAME_HEIGHT-32 ) / 2, 'preloaderBar' ); this.load.setPreloadSprite( this.preloadBar ); this.game.load.image( 'splash', 'gfx/splash_square.png' ); this.game.load.spritesheet( 'explosion', 'gfx/explode.png', 64, 64 ); this.game.load.spritesheet('ship', 'gfx/ship.png', 32, 32); this.game.load.image('bullet', 'gfx/bullet.png'); // load asteroid graphics this.game.load.spritesheet( 'ast_yellow', 'gfx/ast_yellow.png', 64, 64 ); this.game.load.spritesheet( 'ast_red', 'gfx/ast_red.png', 64, 64 ); this.game.load.spritesheet( 'ast_green', 'gfx/ast_green.png', 64, 64 ); this.game.load.spritesheet( 'ast_blue', 'gfx/ast_blue.png', 64, 64 ); this.game.load.spritesheet( 'ast_gray', 'gfx/ast_gray.png', 64, 64 ); this.game.load.image( 'explode_large', 'gfx/explosion.png' ); var bmd_med = this.game.make.bitmapData( 32, 32 ); bmd_med.load( 'explode_large' );// bmd_med.key = 'explode_medium'; }, create: function() { this.state.start( 'Game' ); }};
  11. How come this doesn't work: this.game.load.image( 'explode_large', 'gfx/explosion.png' );var bmd_med = this.game.make.bitmapData( 32, 32 );bmd_med.load( 'explode_large' );it claims 'explode_large' is an invalid key
  12. I think it's just what I want, now if I can only figure out how to use it :-) thanks!
  13. I have 3 sizes of asteroids -- it doesn't matter much to me if the original assets are the bigger ones... the smaller ones will just be taking up space. In any case, no problems, if you can't do it, you can't do it.
  14. What does an object pool have to do with pre-scaling your sprites? I want to cut down on the size of my graphics on disc that less image data, meaning, when I make my sprites in a paint program or spriting program, I make less.
  15. I want to cut down on the amount of graphics I'm making so I would like to make the large versions of my asteroids, and then scale them down. But I want to scale them down once at the beginning so I'm not doing it in real-time. Is there a way to pre-scale sprites within phaser?