Search found 8 matches

by CrowbarBarian
Fri Dec 01, 2017 9:20 pm
Forum: Tutorials and Samples
Topic: Tank!
Replies: 1
Views: 706

Re: Tank!

So I figure people would like to know what the heck the tank looks like and such before they try random code from the Internet, so I made a short YouTube video demo of the tank in action...enjoy: https://youtu.be/-_LdcZKEZEw

I shoulda done this sooner, I know...
by CrowbarBarian
Thu Jul 06, 2017 6:27 pm
Forum: Tutorials and Samples
Topic: Tank!
Replies: 1
Views: 706

Tank!

Here is a little something I whipped up for use in the testbed. It's a TANK! Yaaay! It drives, it shoots, it can even jump. Just drop Tank.h in the 'Testbed/Tests' source directory and add a couple of lines to TestEntries.cpp: #include "Tank.h" in the includes section and {"Tank"...
by CrowbarBarian
Tue Jul 04, 2017 10:21 am
Forum: General Discussion
Topic: How to achieve movement like this
Replies: 3
Views: 479

Re: How to achieve movement like this

Try using

Code: Select all

b2Vec2 scrcoord = g_camera.ConvertWorldToScreen(m_player->GetPosition());

scrcoord will have the position of the player in pixels onscreen.
by CrowbarBarian
Mon Jul 03, 2017 8:21 pm
Forum: General Discussion
Topic: the ball goes through everything
Replies: 1
Views: 429

Re: the ball goes through everything

Try changing

Code: Select all

boarddef[i].type = b2_staticBody;
to

Code: Select all

boarddef[i].type = b2_kinematicBody;
and see if that works at all.
by CrowbarBarian
Mon Jul 03, 2017 8:14 pm
Forum: General Discussion
Topic: How to achieve movement like this
Replies: 3
Views: 479

Re: How to achieve movement like this

I've made a try at coding what you are looking for in the testbed. There is a lot of work to be done with tweaking values and to implement a projected trajectory dot display. But I think I've gotten the fundamentals down for you. The file: Player.h Just put it in the Testbed/Tests folder and modify ...
by CrowbarBarian
Tue Jun 27, 2017 5:54 pm
Forum: Build Issues
Topic: Problem with world.DestroyJoint()
Replies: 1
Views: 796

Re: Problem with world.DestroyJoint()

It's a simple error with the code. You're trying to destroy the reference to a b2RevoluteJointDef, not a b2RevoluteJoint. Add a variable somewhere in your truck class called something like "b2RevoluteJoint* hitch_joint". Then change the line _world->CreateJoint(hitch); to hitch_joint = _wo...
by CrowbarBarian
Tue Jun 27, 2017 3:46 pm
Forum: Bugs, Requests, and Feedback
Topic: making a body rotate to a specified angle
Replies: 1
Views: 471

Re: making a body rotate to a specified angle

Well, if it's not too late, my suggestion would be to use a b2RevoluteJoint and accompanying b2RevoluteJointDef to set up a motor joint. Enable joint limits and set them to your desired angles of minimum and maximum revolution. Then in your game loop whenever you want the catapult to fire, enable th...
by CrowbarBarian
Sun Jun 25, 2017 9:47 pm
Forum: General Discussion
Topic: Subtractive (or negative) collision
Replies: 0
Views: 355

Subtractive (or negative) collision

Hi all, Box2D is a nice physics engine, and seems to be just what I've been looking for. But, before I go ahead and start working on my game, there is one feature that I would like to have which would make certain game-play situations a lot easier and faster to code. What I'm wanting is a sort of CS...

Go to advanced search