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


Similar Posts:


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

Actionscript 3 :: Movieclip Stops Rotating After It's Box2D Body

Nov 30, 2011

I have made a Car Game using Box2D [in Flash] and I have one remaining bug, which I cannot fix. I added graphics and put them on top of the Box2D body. Everything went as good as expected, but after X rotations the movie clips for the car-wheels, stop spinning. I do something like this wheelSprite.rotation = wheelBody.GetAngle() * 180 / Math.PI. I ran a separate program and I saw that, if you do X.rotation += variable and you increase the variable every frame, after ~30 000 (value of variable) the MovieClip stops rotating, so I reset it to 0 after ~28 000. What do I do? The wheelBody.GetAngle()

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

ActionScript 2.0 :: How To Create Somthing That Spins Correctly

Jul 6, 2004

I was wondering how to create somthing that spins correctly when something hits it. (UL...) The gernades make it spin differently the different distances away they are from the center.

View 3 Replies

Flash :: Platform - Create A Colorful Display And Link It To Hard Coded Some Pages?

May 7, 2011

what is the easy to learn platform platform to create a colorful display and link it to hard coded some pages

View 1 Replies

ActionScript 2.0 :: Make A 3D Flash Logo That Spins 360?

Mar 4, 2010

i am designing a web for my friend and i need help making a 3d logo which spins 360 degrees. the logo is of a giant G with a guy on top of it and some minor text.

View 1 Replies

IDE :: Create A Platform Game?

Aug 29, 2007

I have this problem when i go to shot and then have shot the gun all movie clips accessed after shooting dont stop playing but repeat continuously[code]...

View 1 Replies

ActionScript 2.0 :: Create 2d Platform Shooting Game?

Feb 13, 2011

I am creating a 2d platform shooting game. Currently I have my main character walking around left and right and the stage background also moves left and right.

The problem I am having is that if I go to far left the charater just walks 'off stage' and into nothingness but the stage still follows. How can I make it so if the character hits a certain point he just 'stops' and cant go left no more but can go right no problem. I have tried using hitTest with another movieclip but couldnt get it working.[code]...

View 1 Replies

ActionScript 2.0 :: Create The Next Button Which Will Link To Another Scene Containing The Assembled Body Parts

Aug 28, 2005

I am trying to create something like a dress up game. The first screen would be all the body parts(e.g hands,head etc.) and once users click on the next button they will be taken to a new scene with the assembled body parts where there'll be clothes and accessories for users to choose.My question is how to create the next button which will link to another scene containing the assembled body parts.

View 1 Replies

ActionScript 3.0 :: Create A Side Scroller Platform Game?

May 24, 2008

I've been searching online now to find a tutorial on how to create a game like thisI don't have a lot of experience with action script I've only used flash for animations. I found 1 tutorial that was useful but it only gave code and text with out a .fla or images. If you could tell me what I need to do to accomplish this and where to put code ect

View 13 Replies

IDE :: Make A Platform Game - Create Multiple Levels?

Mar 27, 2010

trying to make a platform game using a tutorial on emanueleferonato.com, but I dont know how to create multiple levels. How could I create a door that when touched by the hero is sent to the next level? The tutorial is here:

http:[url]......

View 1 Replies

ActionScript 2.0 :: Get To 9 O'clock Position It Spins Around In Weird Fashion

Aug 1, 2006

What I'm working on is a spinning menu, and it's sort of working, but there is a particular spot where in order to achieve the rotation that I want, the menu spins entirely around instead of just going the 3 degrees or whatever that it needs. I can't quite figure out how to fix it.Note how when you get to the 9 o'clock position it spins around in a weird fashion.[code]

View 12 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 - 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 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 :: 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

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

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

Flash :: Get Position Of A Static Body?

Apr 14, 2011

I have a Box2D world with a mixture of static and dynamic bodies. On collisions, I can only get the positions of the dynamic ones.

Is it possible to get the positions of static objects?

N.b., this is a development of a previous question, Box2D: How to get the position of a sensor?

View 1 Replies

ActionScript 2.0 :: XML Flash Menu + CSS Body ID's?

Aug 1, 2005

I've got a fun problem for ya'll. I've got an XML flash menu with sub menus and all. When you click and menu item with a sub menu, the menu expands nicely. When you click to navigate to a new page the menu "closes" to its basic appearance...

What I'm trying to do is have the menu expanded at the appropriate point automatically if you're on a sub menu page. I've been thinking how to do this and I'm guessing CSS would be the key. Could the flash menu detect a BODY ID and expand appropriately should it detect the right body id.Check out the ZIP file for source files HTML/CSS/FLASH/XML.

View 1 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 2.0 :: Flash Menu + Html Body = 1 Swf (CS3)?

Aug 2, 2010

This clients site has a flash menu, but the content of the page is in html. I know how to write the actionscript so that each menu button links to a different html page. However, I would also like the flash menu to show each page buttons link as "Active" when its on that certain page.For example, I'm on the home page. The "home" link in the flash menu is hilited. I click "products", and the products.html loads. I'm not sure how to write the actionscript so that the "products" link in the flash menu is now hilited. The only way I know to do it, would be to create a different menu.swf for each page. But I'm sure there's a way to do it using only one menu.swf.

Also, I'm doing the menu.swf on a timeline in the fla. I'm not sure how to do it otherwise or if what I need can be done on a timeline.

View 4 Replies

Flex :: Retrieve Body Of A HTTP 403 With Flash?

Dec 15, 2009

I've got a simple YouTube API client put together, written in Flex, that uses a plain ol' URLRequest object to handle Google's "ClientLogin" authentication scheme. Everything works perfectly, except for one case: when Google responds with a 403 and a response body indicating that I should prompt the user for additional information (specifically, a CAPTCHA request).

The problem I'm having is that in this case, I need to be able to retrieve the body of the 403 response, as the body contains information Google expects me to use to assemble the CAPTCHA (e.g., an image URL, etc.). It looks like Flash fails to populate the URLLoader's data property when it encounters a 403 (which is where the response body would normally show up), so I can't tell the difference between a "403: Login Failed" and a "403: Login Succeeded, but We Want a CAPTCHA".

As a backup, I figured I'd have a look at as3crypto's TLSSocket code, but I haven't been able to make any of that stuff work with Google (or even one of my own SSL certs, for that matter).

Is it possible to access the body ofa 403 response with Flash (and if so, how)? And if not,Does anyone have personal experience with a suitable workaround?

View 1 Replies

Jquery :: Body Replacement When Flash Is Messing Around

Dec 20, 2010

I'm trying to replace some contents in a website by using the following code:[code]The problem is that I have some flash embedded on the DOM and whenever I try to do the replacement the browser crashes.Somebody should thing that a prepend or append in the right place should be a better method
to achieve this, but the elements I'm trying to locate and replace are html comments and the append prepend methods do not seem to work with this kind of nodes so they have to be treated as literal strings.

View 1 Replies

ActionScript 2.0 :: Change Body Background From Within Flash

Jan 15, 2003

is there a script that alows you to change the backgroundimage you use in your html from within flash?

View 14 Replies







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