Jump to content


iluvfuz

Member Since 26 Nov 2006
Offline Last Active Private

Posts I've Made

In Topic: Platformer Getting Caught On Flat Blocks

24 February 2013 - 01:11 AM

You should refer to this topic on the same issue: http://gmc.yoyogames...howtopic=559613 . Apparently it is a known problem in Box2D.

From my own experiences, combining the beveled edge (octagon-shaped blocks) trick and using a rolling wheel instead of a sliding block seems to allow the smoothest movement and can be used for other purposes. I posted my attempt on the same topic I linked to as well as in the rope/joint example that you downloaded.

In Topic: Adding 2 Variables Together

20 February 2013 - 12:23 AM

Sounds a lot more like he's trying to use an object array.

For that, you'd want to make small modifications to your code:
for (i=0; i<10; i++) {
	myvar[i] = instance_create(blah);
}
This should store your instances into the variables myvar[0], myvar[1], myvar[2], ..., myvar[9], and you can refer to them accordingly. If you want to work with sorting, you can check out Game Maker's ds_list functions.

In Topic: physics_apply_local_force [SOLVED]

20 November 2012 - 12:09 AM

Did you already try adding this in after you bound the laser instance to its fixture?
phy_rotation = angleOfShot; //Set a static angle for the laser burst
phy_fixed_rotation = true; //Prevents any angular change
Also, physics_apply_local_impulse might be more useful for something like a laser.

In Topic: Help with Rope/Joitn Physics (SOLVED)

20 November 2012 - 12:01 AM

No problem!

Here's an example: https://www.box.com/...hd6axzscupd4jpv

I combined this with my example SmoothWalk (prevents getting stuck on edges of the ground and allows classic platforming movement up and down slopes without sliding around). This way you can actually see the chain rope in action when you touch it. However, if you are only interested in the chain, only look at objControl's Create Action 3, objChainStart, and objChain. If you have any questions, post or PM me. Note that a for loop is not necessary in objChainStart (you can create each chain progressively) but it effectively instantly creates the chain/rope instead of taking a visible fraction of a second.

Good luck!

In Topic: Help with Rope/Joitn Physics (SOLVED)

19 November 2012 - 06:03 AM

Box2D is a rigid body engine, thus, confirming through some hasty research, it seems that it is impossible to create a soft body rope with the native physics engine in Game Maker Studio.

But if you're willing to work around this, it is not a difficult task to get around. The simplest approach that I can think of for its efficacy is in creating a line of elongated rectangles bound to one other by revolute joints. This way, you can have chain that acts kind of like a rope (more chains = more fluidity). Now that it's functionally similar to a rope, you may wish to make it appear more rope-like to the player. A quick search yielded drawing bezier curves like this or this. If you created all of the chain links under a parent object, you should be able to draw a continuous curve that intersects each joint coordinate to give the appearance of a soft-body rope. Read more about it here where a programmer created a chain-rope in Box2D in Flash.

Of course, you can always create your own soft-body rope engine and you can find few resources relevant to Game Maker and many more outside. I don't think it's necessary unless you want tighter control over its mechanics and actually want realism. If you want to follow this path, resources regarding verlet physics would be helpful for accomplishing elasticity: http://gmc.yoyogames...howtopic=142476

Good luck. If you want to go for the first method I suggested but want a demonstration first, I can try creating a small example tomorrow--just PM me if interested.

P.S.: If you were looking for grapple/bungie ropes, decent solution that you can adapt for use: http://gmc.yoyogames...howtopic=377411