Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About blueGrouse

  • Rank
  1. blueGrouse

    A* in a non-tiled game ( AS3 )

    Hey, Thank you for the further explanation. I'm going to read the information at that link and I'm also going to read up local steering. I was going to reply here because I said I would but I haven't got my A* example properly simplified to fit my situation even. I'm really glad to have some clues because things have gotten pretty depressing for the blueGrouse.
  2. blueGrouse

    AS3 hitTest agaist copied pixels

    Hi Tiblac I tried applying that function and listener after I read your previous post. Upon reading your this post I tried it again in a different way. No luck. Maybe you have an effective way of applying the mouse event listener to the copied pixels. I'm new to ActionScript so you might suppose I know how to set things up just so. I didn't post in the newbie section because blitting is only really discussed the advanced books I read. If you know how to implement this technique here I would love to see how it is done. Do you work with copied pixel or blitting much? Thanks, blueGrouse
  3. blueGrouse

    A* in a non-tiled game ( AS3 )

    Hey ApochPiQ, I'm gonna get back to you with more detailed information and some pictures that show the kind of areas I'm working with. I also am going to try to distill the example of A* that is in Van Der Spuy's book... I pulled the classes from the reverse domain folder and so now I have his example working in Flash. Give me some time and check back, that would be awesome. Big huge thanks, BlueGrouse :-) . . . might take a little while . . . trying to detach the fundamentals which are intertwined in a model-view-controller pattern.
  4. blueGrouse

    AS3 hitTest agaist copied pixels

    Tiblanc, It would really help if you could demonstrate what you mean by manipulating the code above. I've experimented considerably trying to interpret your advice and I'm not getting anywhere. If the solution is light work and really obvious to you it would mean a lot to me to see how this plays out. Adobes MouseEvent page doesn't talk about detecting copied pixels.
  5. blueGrouse

    A* in a non-tiled game ( AS3 )

    Right now my A* implementation is adapted from Keith Peters' Advanced ActionScript 3.0 Animation . His walkable tiles are randomly distributed. I want to keep trying at getting an A* class that is consolidated. He has classes for AStar, Node, and Grid plus the main class. I just want AStar and the main class like other people have it, but I don't have the understanding of how to consolidate these classes. I tried. By data structure do you mean something like this to designate walkable nodes? (from Advanced Game Design with Flash by Rex Van Der Spuy: private const FLOOR:uint = 10; private const FAIRY:uint = 01; private var _mazeMap:Array = [ [00,00,00,00,00,00,00,00,00,00,00,00,00], [00,10,10,10,10,10,10,10,10,00,00,10,00], [00,10,00,10,00,00,10,00,10,10,10,10,00], [00,10,00,10,10,10,10,10,00,00,10,00,00], [00,10,10,10,00,10,00,10,10,10,10,10,00], [00,10,00,10,00,10,00,10,00,10,00,10,00], [00,10,10,10,00,10,00,00,00,10,00,10,00], [00,10,00,00,00,10,10,10,10,10,00,10,00], [00,10,10,10,10,10,00,00,10,00,10,10,00], [00,10,00,10,00,10,10,00,10,10,10,00,00], [00,10,10,10,00,00,10,10,10,00,10,10,00], [00,00,00,00,00,00,00,00,00,00,00,00,00] ]; No, I do not have this. And this scares me because my 640 x 480 stage isn't neatly sectioned into 32 pixel squares so my squares must be smaller, like half that, which is still too big for precision! but any smaller and processing time will be dreadful... can you imagine the grids? and for the areas in the game that are really huge maps that move while the player is centered in the stage... oh man I would keep data like this in a separate class for just resources but if there was a way to generate that data with wondrous application somebody wrote that would be good. I'm still super intimidated.
  6. Hey there, I am wondering how non-assessable nodes are identified using A* in a non-tiled game. I plan to blit the sprite and hitTest her against a single bitmapData image in the background to keep her from going out of bounds. I thought about removing the mouse listener when the mouse is over the blocked area but how to let the A* system know there is something in the way and it can't test a node? I'd really appreciate knowing what you think if you know about this!
  7. blueGrouse

    AS3 hitTest agaist copied pixels

    Thanks for the further recommendation about Fixel I will definitely be looking into it! I did try making the canvas the same size as the button but that didn't make a difference. When you say Sprite I'm thinking like a one-frame movie clip, either with the art stored in the library or created in a class and referring to an art file containing one image located in an external assets folder... sorry if I misunderstand you, but I'm trying to work with bitmapData so I can have lots of images on a single tile sheet. I know this seems like total overkill for a single button, but right now, just at the very beginning of trying to make a game, I am only even making basic samples of functionality.
  8. blueGrouse

    AS3 hitTest agaist copied pixels

    hmmm... I'm not sure what vanilla AS is... oh do tell me if you read this! I'll check out Fixel, I've avoided going to a game engine because I'm afraid my game isn't standard and that if I don't understand every detail I won't be able to debug it. Do you suppose it would work for a pixel art, non-tiled, role playing quest game with casual challenges including match three, memory match, quiz, maze chase, horizontal and vertical shooters and strategic battle using the model-view-controller design pattern, incorporating external data from and writing to JSON, and blitting mostly all the graphics ? I spent two years making the art, story and music for a game and so far programming is by far the greatest challenge to me. I'll take some time to learn about Fixel maybe even before I get back to working on my sample of AStar pathfinding. Freakish riddle, there. Difficult to distill the tricky examples into a most basic scenario.
  9. blueGrouse

    AS3 hitTest agaist copied pixels

    When I made the canvas the size of the button and placed the points at ( 0, 0 ) so they would fill just the canvas, the mouse was still sensitive the the whole tile sheet, hidden parts and all. I'm not actually using a Sprite (as in a Sprite that is a one-frame MovieClip). Well, I've got to hitTest against some bitmapData, and the only bitmapData (other than the canvas) that is available is the tile sheet ( _sheet ) . But I think what I really need to test against is the result of this : _canvas.copyPixels( _sheet, _buttonTile, _buttonLoc ); No idea how. Not sure what is right to do. i just know that people make whole games by blitting the graphics so there must be a way to make menu buttons work. It was nice you you to respond to my thread.
  10. Hey there, I'm making this example of a working blitted button. When the mouse is over the copied pixels the hover picture copies over it. it recognizes the lack of pixels in the cut-out transparent shape, but the mouse is sensitive to the rest of the hidden tile sheet! How to hitTest against copied pixels? Much thanks if any one could get me on the right track here! package { import flash.display.Sprite; import flash.display.BitmapData; import flash.display.Bitmap; import flash.geom.Rectangle; import flash.geom.Point; import flash.events.Event; public class BitmapButton extends Sprite { [Embed( source = "tile-set.png" )] private var _Sheet:Class; private var _sheet:BitmapData; private var _canvas:BitmapData; private var _buttonTile:Rectangle; private var _buttonLoc:Point; private var _hoverTile:Rectangle; private var _hoverLoc:Point; private var _mainRect:Rectangle; public function BitmapButton() { render(); addEventListener( Event.ENTER_FRAME, detectMouse ); } private function render():void { _sheet = new _Sheet().bitmapData; _canvas = new BitmapData( 640, 480, false ); addChild( new Bitmap( _canvas )); _buttonTile = new Rectangle( 0, 0, 200, 100 ); _buttonLoc = new Point( 80, 150 ); _hoverTile = new Rectangle( 0, 100, 200, 100 ); _hoverLoc = new Point( 80, 150 ); _canvas.copyPixels( _sheet, _buttonTile, _buttonLoc ); } private function get mouseLoc():Point { return new Point( mouseX, mouseY ); } private function detectMouse( event:Event ):void { if( _sheet.hitTest( _buttonLoc, 0, mouseLoc ) == true ) { _canvas.copyPixels( _sheet, _hoverTile, _hoverLoc ); } else if( _sheet.hitTest( _buttonLoc, 0, mouseLoc ) == false ) { _canvas.copyPixels( _sheet, _buttonTile, _buttonLoc ); } } } }
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!