Flash :: Movie-style Shotgun Blast (sticky Collision) With Box2D?

Jan 29, 2011

I'm making a Flash game where the player throws balls of mud at objects in the sky. I'm using Box2D to model the physics. I don't want the ball to bounce off of objects (apply a normal force); instead I want it to impart its momentum on the object it is striking (like a movie-style shotgun blast).

View 1 Replies


Similar Posts:


Flash :: Box2d, Detect Collision Between Static And Dynamic Bodies?

Apr 12, 2011

i am listening contact between dynamic bodies. But cannot listen contact between dynamic and static bodies .

I can handle collision detection on my b2contactListener class with this metod.

public override function BeginContact(contact:b2Contact):void {
// getting the fixtures that collided
var fixtureA:b2Fixture=contact.GetFixtureA();

[Code].....

View 1 Replies

ActionScript 3.0 :: Box2D Collision Categories - How To Work

Jan 13, 2011

I still have problem understanding how the collision category works. I'm only able to make it work by experimenting which is not good.

[Code]...

this works the way I wanted but only because I experimented around and found the right values (or at least values that work). I would prefer to know how the whole system works

View 6 Replies

ActionScript 2.0 :: Make Blast Loud Without Changing Value Of Other Sounds?

Jul 24, 2009

I'm making a game in AS2. And I have made it so when explode is triggered it plays a "BOOM" sound, named blast. I wanted the "BOOM" sound to be louder the bigger the bomb, which you can charge up. To do this I have put...

Code:
variableName = new Sound();
variableName.attachSound("blast");
variableName.setVolume(player._width*0.75);
variableName.start();

And this works fine. My only problem is that I have other sounds in my game and this changes the volume of EVERYTHING in the game each bomb. How do I make "blast" louder the wider the "player" is, without changing the volume of the other sounds?

View 3 Replies

ActionScript 1/2 :: Create An AJAX Style Pop Up To Present Photos From A Flash Movie?

Oct 28, 2009

I would like to create an AJAX style pop up to present photos from a flash movie. I found a tutorial, but it didn't work for me. I'm trying to trigger it off the gerURL function of a button, but nothing popups. I have verified that a simple link in <a> from the html page the flash movie is on works fine, so it's just the call from flash itself.

View 4 Replies

ActionScript 2.0 :: Making MCs More Sticky?

Jun 30, 2009

I'm looking to make my MC's (acting as buttons) more sticky.What I mean by 'sticky' is to enable Rollover effect to hold if the user tries to click on the link within what is revealed onRollover (in my example it's 'sub-inline text link')Currently. The hit area of the MC's do not allow me to mouse over those links within. I can't simply enlarge the hit areas of the MCs because they will ultimately be tightly spaced from one another.

View 4 Replies

Flash - Paddle Movement Using Box2D?

Jan 3, 2011

I'm making a game like Arkanoid and to move the ship with mouse, I'm using the following code :

var mousex:int = costume.stage.mouseX;
if (mousex < paddleWidth/2)
mousex = paddleWidth/2;
else if (mousex > PhysiVals.STAGE_WIDTH - paddleWidth/2)

[code]....

Everything's going fine there! The paddle is moving the way it should! The problem is I want a little inclination towards the direction its moving and when it stops moving the angle of inclination should become zero.

View 1 Replies

ActionScript 3.0 :: Flash Box2D & 2D Shadows

Jul 24, 2011

I'm working on a AS3 Game Engine at the moment utilizing Box2D (2.1a) and 2D shadows. I have Box2D down but I've yet to find a way of drawing 2D shadows efficiently.I was following this tutorial only to be disappointed by the speed at which it rendered the Box2D shapes and the shadows.I was getting the vertices of the objects via this function:[code]And using it to draw the shadows via the AS3 graphics api.Can anyone recommend me a better more efficient way of programming 2D shadows?

View 2 Replies

Flash :: Change Center Of Rotation Box2d?

Feb 13, 2011

I have a b2PolygonShape body and apply a force to it.

_recbody->ApplyForce( b2Vec2(6.0, -6.0), _recbody->GetWorldCenter() );

I want to change the centre of rotation of the body to be more in the front of the body. So that applyForce and also collisions make the body not turn in the centre but more in the front.

View 2 Replies

Flash - Drawing Custom Polygons In Box2D?

Apr 14, 2011

I'm making a Flash game, and I've encountered a really weird problem while trying to draw a polygonal shape in Box2D.

Here's the code I use:

var fixtureDefs:Array = new Array();
...
var fDef:b2FixtureDef = new b2FixtureDef();
fDef.density = 0;

[code]....

Where vertexArray is a valid array containing 4 b2Vec2 vertices, making up a convex shape.The problem is, when I test, collisions don't work right for that body. Most other objects -enemies, user-controlled characters - pass straight through, as if the body isn't there at all. Some raycasts pass through as well.

Infuriatingly enough, one kind of bodies I have (a custom enemy) somehow does detect the body and collides with it. The raycasts that particular kind of enemy attempts do work - when your character hides behind the polygon, it's like they can't see him.The other weird thing: when I try the same code, only go for SetAsBox instead of SetAsArray, it works exactly as it should.I'm using a custom ContactListener class, but I haven't done any contact filtering (unless it's possible to do that without realising).I'm using the Flash 9 version of Box2D 2.1a.

View 2 Replies

Rotating And Throwing Objects Using Flash And Box2D 2.1a?

Jul 26, 2011

i'm using flash with box2D 2.1a. i'm rotating ball hanging on the string. The path which the rotating ball trace is ellipse. When releasing the rotating ball from the string i want the ball to fly with the obtained direction, velocity and strength. As you can see in the pictures.[URL]..I've tried to do it with setPosition (method of b2Body) and with various joints. But I haven't got the needed results.

View 2 Replies

Flash - How To Climb Up Or Stick To Other Objects In Box2D

Jan 12, 2012

I know that trying to model character movement in Box2D is always hard/impossible, but I'm trying to see if there's any way to make an user-controlled object that cleanly slides against other objects, going up or down, that makes it look like the character is climbing/walking up or a down. The character could be modelled as a circle if that simplifies matters, but I don't see how I could get this effect using just a circle with a joint motor.

There's a "wheel joint" in the C++ version of Box2d, which I suppose I could port to Flash, but I don't know if that would give the correct effect either. Another idea I had was to have the character do little jumps, based on the normal of the object that it is touching. But I suspect that at corners, or at contacts with multiple objects, this will give weird results.

View 1 Replies

Flash :: Box2d Body Shape Modification?

Jan 13, 2012

Is it possible to modify a shape within a body after assigning it, for example I have a box shape for my game hero body, and when I press the down arrow I want my hero to crouch witch means that I need the body shape to be resized.

I've already searched in google but it appears that the topic of modyfing shapes is not so popular. If it's impossible maybe you know a better way of doing this.

View 1 Replies

Sticky And Malfunctioning Buttons - Works Not All The Time

Apr 18, 2010

I have these navigation buttons (code below) and only some of them work and not all the time.

[Code].....

View 1 Replies

ActionScript 2.0 :: Do A Horizontal Menu With A Sticky Element

May 2, 2005

I need to do a horizontal menu with a sticky element.It looks like that :[URL] If the mouse is rolled over the menu item, then the yellow thingy slides above the section name with easing. I have seen it somewhere on the internet, but couldn't find how to do it on the forums.

View 2 Replies

Flash :: Box2d B2BodyDef Have A Massdata Property In Cocos2D?

Mar 9, 2012

I want to know if box2d b2BodyDef has a massdata property or if it can be accessed in some way. I am not sure whether this can be done in Cocos2D but I have seen it in the flash code I am trying to re-implement in cocos2d.Here is the the code that brought about the question.

[Code]...

View 1 Replies

Flash - Create A Platform Body That Spins On It's Center In Box2D?

Feb 24, 2011

I'm trying to create spinning shapes floating in space. There is still gravity in the environment, however it should not affect these platform objects because they are static (right?). How can I apply a constant angularVelocity to it though? It doesn't seem to apply when I assign it a value, probably due because it's static.

The simplest example would be a spinning gear, an automated teeter-totter (not influenced by external forces). All I'm trying to make is a spinning rectangle that could interfere with a ball controlled by the user.Do I need to use Joints to pin it in place? How can I specify the details of not being influenced by the dynamic objects?

View 1 Replies

Flash :: Preventing Box2d Player From Pressing Against Walls In Midair

Nov 20, 2011

I have setup a box2d world with a keyboard controlled player. The player can walk and jump. How do I prevent the player from "sticking" to walls while jumping and pressing the directional key towards an object?

View 3 Replies

Actionscript 3 :: Box2D In Flash Runs Quicker When Drawing Debug Data Than Not?

Jan 24, 2010

I've created a small game with Box2d for AS3 - I have sprites attached to the stage that take their position from the underlying Box2d world. These sprites are mostly PNGs.When the game runs with DrawDebugData() bening called every update, it runs nice and smoothly. However when I comment this out, it runs choppily. In both cases all my sprites are being rendered. So it seems that it's running faster when it's drawing the debug data additionaly (i.e. my sprites are on the screen in both cases!)What's going on? Does drawing the debug data flick some sort of 'render quick' switch? If so, what's the switch!? I can't see it in the Box2D code.

function Update(e){
m_world.Step(m_timeStep, m_velocityIterations, m_positionIterations);
// draw debug?[code]...

Interestingly, If i set the debug draw scale to something different to my world scale, it slows down to 19fps. So there's something happening when it draws the boxes under my sprites causing it to run quicker..

View 2 Replies

Actionscript 3 :: Flash + Box2d Pool Game Breaks Online Because Shots Are Not Transmitted Precisely?

Dec 25, 2010

I'm, working on this pool game: [URL] open it in TWO browser windows you will see that the 2 player modus starts. When you make a shot, every shot gets copied to the other player. Unfortunately it is not precise enough. The player makes the shot with this code:

[Code]..

View 2 Replies

ActionScript 3.0 :: Collision 2 Movie Clips?

May 5, 2010

i have 2 class both are for 2 different movie clip.1 called target and the other called bullet.the targets are moving left and right, while the bullets will move everytime i click my mouse.i want to check if the bullet hit the target or not.(collision?) how to check the collition between 2 moving movieclip ?

View 2 Replies

ActionScript 2.0 :: Collision Detection - Goto A Certain Scence When A Movie Clip Collides With Another Movie Clip

Jun 22, 2005

i am making a pacman game, and i need to know how to make it go to a certain scence when a movie clip collides with another movie clip.

View 2 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 :: Making An Interactive Movie (QTE-style)?

May 8, 2010

i'm currently in the process of linking a movie i've made into a series of interactive scenes, which can half the outcome altered depending on if the player chooses to press certain buttons within the movie. As an example, at one point the character is asleep, and the text "Wake up" appears on the screen, at which point the viewer would press the a or the l key to do the action. If they fail to press a key, the character sleeps forever and the movie ends.I'm making this in Flash.

However, I have such a basic knowledge in actionscript and cannot find a tutorial online to help me with what i'm aiming for. I know how to switch to playing different scenes using actioscript but not how to set it up so that pressing the a or l keys (these are specific to different actions the user can take, only chosen to allow them to have both hands on the keyboard at once to give it their full concentration) to specifically play events.

View 1 Replies

ActionScript 3.0 :: Make An Interactive Movie (QTE-style)?

May 10, 2010

I'm in the middle of making an interactive movie with events within it that act sort of like quick time events, only that there are multiple outcomes, making it sort of like an old "Choose your own adventure" book. I'm certain you can do what I want to do within Flash, but I have no idea how to as the only commands I know in Actionscript are stop(); and play(); and i'm not sure what the (); means, only that I needed it.

However, all I need is some simple commands to make it so that when the viewer hits the "a" or "l" key, the film will advance to another frame. These keys are meant to correspond to two different actions in the film depending on the situation - At one point, to leave through a door or dive through a window, and at another to dodge left or right away from an object. Though there is a third option for when the player does nothing, that should be simple enough to code so it's not a problem.

View 4 Replies

ActionScript 2.0 :: Wheel Of Fortune Style Movie

Feb 9, 2011

I am doing a wheel of fortune style movie, where the user spins the wheel by flicking it with their mouse, and when it lands it performs an action. I am working with a script that works great - I just have been trying to change it from using a button to trigger the spinning to using the mouse to drag/flick it. Currently, the stage holds 3 movieclips :- wheel, pointer and spin_btn. I want to eliminate "spin_btn" and physically spin the wheel with the mouse.

Code:
//Import the Tween Class and the Transition Classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
//Set up an Array to store the segment details i.e., segment value, colours etc
//(Here I've only used 5 colours and values so each one is in triplicate on the wheel,
//if you wanted each segment to be different just enter 15 different values into the array)
[Code] .....

View 3 Replies

ActionScript 3.0 :: Collision Detection Inside A Movie Clip (rather Than With Its Bounding Box)?

Aug 21, 2011

I want to navigate a maze and therefore I want to create collison detection with the maze itself, but when I try the collison is made with the entire maze movieclip, so even if my character is safe in a corridor without touching the walls of the maze it still counts as collisons.

View 1 Replies

ActionScript 2.0 :: Make A Collision Detection Between A Separate Movie Clip?

Jun 16, 2005

Is it possible to make a collision detection between a separate movie clip and another movie clip that is with a movieclip thats on the same layer as the seperate one?

View 8 Replies

ActionScript 3.0 :: ComboBox Style: Can't Style Text

Oct 23, 2009

I've got a comboBox component on the stage, instance name 'combo'. I want to style the text. I followed the adobe instructions, but they seem not work, and I get no errors.

Code:
import fl.data.DataProvider;
import flash.text.TextFormat;
var tf:TextFormat = new TextFormat();

[code].....

View 2 Replies

Javascript :: Lightbox-style Dialog Shows Below YouTube Movie On Mac OS 10.6?

May 13, 2010

I have a lightbox-style HTML dialog that shows a menu on top of a web page. It can be injected into any web page via a JavaScript bookmarklet.

One of my users is trying to use it on YouTube.com with the result that the flash movie is rendered on top of the dialog (a div with high z-index).I can't reproduce this. It works just fine for me. The dialog shows up on top of everything else on youtube.com, the video included.I had him save the page in Safari as Webarchive and send it to me. Even that shows the menu rendered correctly for me.

I use the exact same version of Safari (4.0.5/531.22.7) and Flash (10.1 r53, latest beta). Only difference I could find is that he uses Snow Leopard (10.6.6) and I "only" 10.5.8.

View 1 Replies







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