"BiG"

The result of our 24 hour game programming competition: http://www.sfu.ca/~mnb2/Big.swf
My first time using Flash. We gave up and went to sleep after about 13 hours... so that's the result of 2 or 3 hours of planning, and ~10 hours programming. Made it with a friend.

There really isn't much to do unfortunately. Didn't get far enough in.
There idea was this:

You're a small little dude, been living in a mouse hole your whole life. Then one day you notice a crack in the wall. And the crack gets bigger and bigger until you're able to escape, and then you find yourself in this house, and you have to find a way out.

In the first room, you're supposed to pull a book off the shelf, use so that you can jump on the chair, and push the cheese off the table. You have to pull another book off the shelf (secret lever) to slide the shelf over, to reveal a second mouse hole (where a mouse actually lives). The mouse will come get the cheese and give you a magnet. The magnet is used to swing yourself up to the lamp, so that you can grab the non-existent light bulb. But you have to position something under the lamp (maybe the cheese) so that when you drop the bulb it doesn't break. You have to smash the radio to get batteries. Check the mouse hole to get a flash light, combine those 3 items to fix the flashlight. The upper half of the room is supposed to be dark. You shine the light to reveal a vase (which is supposed to have a piranha plant/venus fly trap inside it). You rip out the plant, which may try to eat you, then carry the vase of water over to put out the fire, and grab the key out of the fire. You then use your magnet to latch onto the door handle of the non-existent door, and open it to escape the first room. The crack in the window is also supposed to reveal something cool, but I have no idea what.

Anyway, none of that really made it into the game, so...this is the result of our labor, and my fantastic art skills.

Oh, and the tables, and chairs and everything are supposed to smush you if they collapse on you (they do actually collapse...). The lamp cord is made of a "bridge" which looks pretty sweet when it swings around, but unfortunately you can't really make it up there in this demo. I think it would be cool once I had the light attached...

Oh, here's your goal for the demo: knock the vase off the bookshelf.
cool! how did you get the lamp to swing like that? like it is elastic?
Hey man, that is really nice.

what is curios me is how were you able create another object out side of the box2d peremiss.
i'm a game design student in VFS and we are just starting in production of the final project.

we have a similair concept to yours but it is about a dude that lives in a fridge.

if you can tell me how were you able to interact between the character and a box2d object
that will be awesome. 😀
The lamp cord is the same as the bridge in the demo (as stated). In fact, it's copy and pasted with some slight modification. Just a bunch of rectangles linked with revolute joints.

There are no objects outside the Box2D "premises". There are some walls off screen, but they are within the box2d world bounds.

Linking the Box2D objects and graphics objects are also demonstrated in one of the demos. Simply create your Box2D Body as normal, then use the userData to store a pointer to a Sprite. Set the width and height the same as the Box2D extents, times two. Update the X and Y of Sprite every frame, based on the body's X and Y.
Allright, so the character in your game is it a box2d object with a sprite, so how do you move it around?
I suppose he just changed its linear velocity, at least thats what i do.

Do i have to much time if i tell you i reached the lamp 😀?
Well i tried to change the linear velocity, but it is ignoring gravity so
all the objects going to 1 direction.

is there a way to do the same thing but without ignoring gravity?

I'm sorry if my question sound a little bit noobish.
Babelduo wrote:
do you know how we can solve this problem? 🙂


Stop applying the linear force?

Bill
alonm10 wrote:
Allright, so the character in your game is it a box2d object with a sprite, so how do you move it around?


My friend wrote that bit of code, so I'm not sure how he did it specifically in this example, but I've been applying an impulse (with a few conditions).

Babelduo wrote:
hehe nice! 🙂

you have the same problem like me... if you jumping at a wall (ex. the left big wall) an holding "left"
you hang there while pressing "left"... i think its the problem with ApplyImpuls...

do you know how we can solve this problem? 🙂


Yes, I do actually. I solved it and made a post about it before even beginning this project (just didn't get around to implementing it in this demo):
viewtopic.php?f=3&t=353&p=2045#p2045

MadsGustaf wrote:
Do i have to much time if i tell you i reached the lamp 😀?


Too much time on your hands? Probably. How the heck did you do that?
Babelduo wrote:
Quote:
Bill
Babelduo wrote:
do you know how we can solve this problem? 🙂


Stop applying the linear force?

Bill


yes u are right but i searched for a easier way 😉


Right, we'd all like something easier 😀

But think about it... if you're still applying a force in the direction of the wall you're going to have some problems with sticking to the wall. The physics simulation can't interpret it any other way.

Bill

Original thread: https://box2d.org/forum/viewtopic.php?t=529