ActionScript 3.0 :: Blitting + Pixel Perfect Collision?

Oct 23, 2011

I'm using a blitting engine that uses bitmapData. No display objects.Is there a fast pixel perfect collision detection available for such a game system?I already tried CDK but that didn't work because it assumes you have display objects which my objects don't use. Sometimes my objects are pretty big and hitTest sucks in this case. I already tried circle-to-circle collisions but that didn't do the trick either.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Pixel Perfect Collision Detection?

Jul 11, 2009

need build pixel based collision dectection class , i have found some classes already built by different people and they are really usefull, but as i want to build one of my own, i need to know basic theory behind tha

View 3 Replies

Actionscript 3 :: Find A Pixel-perfect Collision Detection Function

Mar 18, 2010

I was searching for a simple collision detection function for as3, I found Collision Detection Kit, but it is too complicated, I just want a damn function that I give 2 objects as paramenters and that's it.I would like to know where can I find a pixel-perfect collision detection function (The faster, the better)

View 2 Replies

ActionScript 3.0 :: Pixel-perfect Collision Detection With 5000+ Particles?

Dec 5, 2009

I just thought I'd drop a note here to those who are interested. I recently posted about it on my website and you can download the source for it there too. Here's some excerpts:

Ive run it at 60+ FPS with 7,000 particles, but that actually isnt the limitation (unless your particles are crunching heavy math for eg movement). Rather its the size and number of sprites that were colliding with the particles.

To squeeze all the juice out of Flash I employed a couple tricks. The first was the particles themselvestheyre blitted to a single bitmap which is used as the source image for grabbing collision data from. The particles are also drawn with the raster engine in Flash (multiple setPixel32() ops to give the illusion of a line a choppy one anyway) instead of the vector renderer (lineTo()).

The second trick was to only grab a Vector of pixels from the regions we cared about (within sprite boundaries) every so often, then to loop through the Vector and test it against our desired conditions. Also, since the particle bitmap is more sparse than our sprites as far as opaque pixels go, we test the particle bitmap first, resulting in a lot fewer passes on the first round of conditional statements.

That's the gist of it, but I explain it a bit more in detail in the post. Hope someone finds this useful and please let me know if you come up with something cool using it

View 5 Replies

Professional :: Pixel Perfect Hit Test?

Nov 13, 2011

What is the SIMPLEST way to make a pixel perfect hit test class?

View 41 Replies

Flash :: Get Perfect Pixel Line Rendering In As3

Jan 7, 2010

I'm making an arcade game in as3 and I want to draw pixely(unsmoothed by flash) lines. I'm drawing the pixels 'by hand'(not with flash's lineTo or anything) onto a bitmapdata object. The lines don't appear quite right though, when zoomed out the line is rendered 2 pixels thick at some parts. However by zooming it its apparent that the algorithm is fine and its not doubling the pixels. Changing the quality doesn't seem to change anything.

[Code]...

View 2 Replies

ActionScript 3.0 :: Movieclip Hit Area, Set To Dimension, Instead Of Pixel Perfect?

Dec 4, 2010

i have a simple movieclip, based off text, with a few frames, and instead of creating an invisible area to do the hit test, is there any way to set the hit area to equal the movieclip's dimensions?, google seems to not be able to provide results, i don't need pixel perfect hit detection, but rectangle detection

View 2 Replies

ActionScript 2.0 :: Bitmap Hit Testing - Pixel Perfect Collisions

Mar 31, 2007

I have been desperately searching for a way to do pixel perfect collisions, and for someone to explain it to me in detail. explain the code in the .fla file, posted by the Canadian in the frequently asked questions thread on bitmapData hit testing:

[Code]...

after looking through the help files, i must admit they are terribly vague. All you are doing is checking if _alpha is above a certain amount. With movieClips you would use 0->100 but with this hittest you have to use 0->255 (0x00->0xFF)so an _alpha of 50 would correspond to approx 128 (0x80). Nearly all the time you could just use 1 as a hittest parameter so you are checking for any hit at all but maybe you have a shadow in a mc layer and you do not want to check a hit. This is when you might be able to use your threshold parameter. In other words, the hit test will only react to parts of the bitmap which have a greater or equal alpha than the alpha threshold, mostly useful for a shadow.

View 1 Replies

ActionScript 3.0 :: Irregular Semi-Perfect Collision?

Jul 15, 2011

I have a bunch of different Movieclips from about 10 different classes moving about the stage. What would be the fastest/most efficient way to detect collisions between two of them? They can overlap each other a bit before the collision is detected, so I thought the easiest way would be to draw a couple rectangles that take up a majority of the object for each class and use hitTestObject to see if any of the invisible rectangles of one instance are colliding with the invisible rectangles of another. Is this a good method? I figured that since a bit of overlapping is okay and actually preferred, that two or three rectangles can easily take up all the room I need for each object.

View 2 Replies

Actionscript 3 :: Pixel Collision Detection For Flash

Jan 11, 2010

I was told the pixel detection is costly for regular windows games. Is this the same for flash ?? Or would pixel detection be lighter compared to other detections flash has to offer. Flash has the getPixel32 method which makes it easy for detecting pixels. If I am bliting my game, would it be wise to use getPixel32 for collision detection. Or should I just check for specific tiles?? Is getPixel32 limited to the display object it is in ?? In other words, can I detect any pixel regardless of what layer it is on in the display list.I probably can figure this out on my own but I want to ask first to save me some time. But does anyone have any code or good sources on how to go about doing this if it is reasonable.

View 6 Replies

ActionScript 3 :: Improve Performance Using Blitting For Graphics?

Sep 9, 2010

I am a bit new to using blitting for graphics. But I have worked up a few demos myself, and I have been reading a lot of information on the methods used. One common theme I have been seeing though is that all of them brute force rendering; drawing the farthest back object first and stepping through all other objects. even drawing objects that are going to be completely overlapped. The reason all of them say this is that any kind of testing to see what should be drawn actually takes more time than just drawing everything with no checks. Is there any kind of way to detect what should be drawn, that will run faster than just drawing everything?

View 1 Replies

ActionScript 3.0 :: Unable To Use Tile Sheet For Blitting?

Feb 20, 2012

I am trying to get bitmapdata from a loader to be able to use my tile sheet for blitting. I seem to be unable to get it to work. After some testing I noticed that none of the code after this piece is executed in the SWF, so apparently it always freezes at this point:

ActionScript Code:
tileSheet = (evt.target.content as Bitmap).bitmapData;
bmp = new Bitmap(tileSheet);
addChild(bmp);
Obviously I am doing something wrong.

View 9 Replies

ActionScript 3.0 :: Blitting CopyPixels With Pooling BitmapData?

Nov 7, 2010

What do you think about mixing this two up? Would it lead to better performance for the scenario described below?However, method done below still contains jerking/stuttering in animationWhat my app does is to create a random mix of smiley and draw it into the canvas, and update the movement of the smiley (x,y)I have a source bitmapdata containing different smileys each of the same size.Example:The app creates a random mixture of smileys inrandom length;Example:tc...I have 2 vector that acts as pool. 1 vector is to store bitmapdata1 vector to store SmileyObject (SmileyObject has 3 properties, positionX, positionY,bitmapData)If the pools is empty, I create a new bitmapdata and SmileyObjectThe bitmapdata copypixels random smileys from the source bitmapdata.This is then placed into SmileyObject.I have a loop that goes through each smiley objectand copypixel each bitmapdata into the canvas along with the x,y position.However, even with copypixel and pooling bitmapdata + smiley object,I can still view the stutter / jerk / stuttering / jerking in the smiley animation.

View 6 Replies

Flex :: Comparing Bitmap Data In AS3 Pixel For Pixel

Mar 30, 2010

I am looking for a fairly simple image comparison method in AS3. I have taken an image from a web cam (with no subject) passed it in to bitmap data, then a second image is taken (this time with a subject) to compare this data, from these two images I would like to create a mask from the pixels that match on both bitmaps. I have been scratching my head for a while, and I am not really making any progress. Could any one point me in the right direction for pixel comparison method, something like getPixel32()

View 2 Replies

Actionscript :: How Much Faster Is Blitting Than Using Vector Sprite Objects In Flash

Feb 18, 2011

I know there are different situations where one would be better than the other, but I'm comortable with a generalized statistic of... How much faster is blitting than using vector Sprite objects in Flash?

View 2 Replies

ActionScript 3.0 :: Get Pixel-by-pixel Bitmap Data?

Nov 23, 2009

I have a 100x100px image. I want to get 1 pixel vertical line from x- 1 to 100. How can I do that?

View 7 Replies

Collision Detection Incorrectly Detecting Collision?

Oct 16, 2009

In my file (AS2), I have a small square at the middle of the page. Diagonally to the right, I have a vertical wall which is a rectangle. Pasted inside my small square, I have the code:

onClipEvent(enterFrame) {
if (Key.isDown(Key.RIGHT)) {
if (this.hitTest(Wall._x, Wall._y, false))  _x =

[code]......

View 1 Replies

Actionscript 3.0 :: Blitting Lines - Draw Approximately 50000 Lines And Performance Is Poor?

Aug 17, 2011

I have been working on a map viewer based blitting technique. As part of the map I need to draw approximately 50000 lines and performance is currently really poor.

Code: Select allvar movie:Shape = new Shape();
for( ... )
{
movie.graphics.clear();[code].....

View 2 Replies

ActionScript 2.0 :: How To Do A Perfect Load Of A GIF

Feb 28, 2006

i have a GIF and i want it to be loaded dymanicly from XML with [code]the GIF isn't playing. my GIF has 4 stages (frames) but when loaded, it stays only on the first one. i need the GIF loaded and begin looping all 4 frames... what's happeing ?i want the loader_MC to be resized everytime i resize my Stage. i did this:[code]The GIF appears distorted, turned upside down and the _x axis very wrong and out of page... what's happening, again?

View 3 Replies

ActionScript 2.0 :: Perfect Keyboard Movement?

Jul 11, 2009

on the stage, ther's a box. you can move the box with the left and up key.i have 3 problems:

1. the movement isnt smooth, can i make the movement smooth without modyfing the speed?

2. i want that when you press the left and up key simulteanously the box will move diagonaly.

3.when you press and hold a key, the box just moves a little and after 1 second (or something like this) the box starts to move continously. can I make the box to move continously immediatly after you are pressing a key.

View 2 Replies

ActionScript 2.0 :: Perfect RollOver And RollOut?

Sep 28, 2011

I've been searching around and can't quite seem to find the answer. I gather it's a problem with actionscript, but, i digress.

What's going on is if I move my mouse too fast it won't activate either the RollOver or RollOut, and it'll just stay. Is there a certain way I need to set everything so it will NO MATTER WHAT animate when rolledover, and then ALWAYS RollOut?

View 2 Replies

ActionScript 2.0 :: Get Perfect Scroll Percentage?

Oct 22, 2009

i want get scroll percentage form 0 to 250 point having a Line large 95px and dragger large 10px. I make this script but it dont perfect to get value. It's fast to update value.[URL]

dragger.onPress = function() {
dragger.startDrag(false, 0, -14, line._width-dragger._width, -14);
this.onEnterFrame = updateValue;

[code]......

View 1 Replies

ActionScript 2.0 :: Perfect Fade/multibuttons?

Aug 22, 2004

I picked up code for the "perfect fade" a while ago, which I have used for buttons in te past.

The code is as follows. On the root timeline:

[Code]...

Now this all works great, but its not too modular, meaning I have to write a fair amount of code for each button.I'm trying to make it leaner, by having a global function, but I can't get it to work properly... i think due to the enterframe. I've been unable to make it loop, and therefore it only steps forward oneframe, and back one frame.

View 1 Replies

Swf Works Perfect Offline But Not When It Is Uploaded On The Internet?

Oct 12, 2009

this is my first flash test and I have been stuck for weeks to solve this issue. I am currently with Mediatemple, standard gs plan, and I have three files that I wish to upload:
 
index.html (html file)
ProgBar.swf (Preloader)
Main.swf (External Swf that is being loaded)
 
If you open the html file locally on a computer, it works fine, however the problem arises when these files are uploaded to the internet,. It doesn't seem to work at all... Please help me figure out why. Thank you for your consideration.

View 2 Replies

ActionScript 3.0 :: A Perfect Half Circle Using Only The Drawing API?

Dec 17, 2008

any techniques they use to draw a perfect half circle?

I've seen the curveTo() method, and I cannot seem to make it come out with anywhere nearly good enough results. It always looks like half of a skewed ellipse.

I don't *want* to use a mask -- since there will be other drawings on this same Sprite that I do not want masked.

To be even more picky -- I don't *want* to create the half circle in another Sprite and add that to my original drawing.

View 9 Replies

ActionScript 3.0 :: Text Transition - Getting The Positioning Perfect?

Jun 7, 2010

ok what i'm trying to do is make a transition so letters get typed up and then a tween will be applied and will be tweened down to about middle of screen. here is what i have so far:

ActionScript Code:
var q:Number = 1; // controls amount of letters currently visible
var typeInterval;[code]....

the problem is i have the typing but i've had alot of trouble with tweening side of things. i figured i might be able to create a new textfield for every letter assign the letter to it then tween it. but getting the positioning perfect would be a pian and i have no idea how to continure form this point on.

View 0 Replies

ActionScript 3.0 :: Make Perfect 3d Engine For Flash?

May 25, 2011

So, been looking for a way to make the perfect 3d engine for flash. I need to know though, what am I working with? Pixels? Can I use something to access the video hardware? Already taking a few math classes on Monday to get a fresh start so I need to know the best way to go about this. Like...how does the video card draw?

View 0 Replies

ActionScript 2.0 :: Perfect Sound Loops In Flash?

Apr 28, 2006

i'm using the loadSound command to bring in an external mp3 and although the file itself is a perfect loop, flash doesn't seem to like playing it back as such using the s.start (0, 5) tag. any suggestions on how to get perfect loops?

View 3 Replies

ActionScript 2.0 :: SPrite Sheet Cutting Perfect

Jan 13, 2007

I can cut sprite sheets but i wanted to knoe some tips on getting it perfect right to the charcter so there is no box around the charcater.

View 1 Replies

ActionScript 2.0 :: Install Newsticker And It Worked Perfect

Jan 25, 2007

I tried to install the newsticker and it worked perfect. I still have a problem: there is no way to use the accent they just get ignore. I also tried to code them in html in the xml file but it didn't work.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved