FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Block'd game question

 
Post new topic   Reply to topic     Forum Index -> Blaze
View previous topic :: View next topic  
Author Message
mike



Joined: 28 Dec 2008
Posts: 34

PostPosted: Sat Apr 25, 2009 8:23 pm    Post subject: Block'd game question Reply with quote

I created a game called Block'd. I haven't finished all the levels but I do have one level for you guys to play.



I mostly have a question on the behavior of the attractor that i put in place which is one of my reasons why im posting this now. The attractor only attracts the objects not the player. Im just wondering if it is working properly or if I screwed something up. I noticed that some shapes act very oddly which I can't understand why.


Here is the file.
http://www.box.net/shared/lcf03o6i5t

I couldn't find much information on these forces. I didn't see anything about this on box2d wiki. Wink
Back to top
View user's profile Send private message
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Tue Apr 28, 2009 11:37 am    Post subject: Re: Block'd game question Reply with quote

mike wrote:
I created a game called Block'd. I haven't finished all the levels but I do have one level for you guys to play.


Great job; it's a good start!

You should be able to attach the attractor to any body. In what manner are you using it? It's difficult for me to notice in the demo.

It may help to include your code with the demo, or post code samples, if you're looking for specific help.
Back to top
View user's profile Send private message
mike



Joined: 28 Dec 2008
Posts: 34

PostPosted: Tue Apr 28, 2009 5:53 pm    Post subject: Reply with quote

Thanks zzzzrrr.

Heres my code of the attractor


Code:
        //Attractor
        bzAttractor attract;

        for (int i = 0; i < lvl.makeobjects; i++)
        {
            attract = new bzAttractor(lvl.bodyObject[i], bzVec2(12.5,9.375), 5,3, 10);
            bWorld.addForce(attract);
        }


Right now I am adding the force while it is static, maybe if I add the force as soon as it is no longer static that might help me out. Do you think that would make a difference?
Back to top
View user's profile Send private message
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Tue Apr 28, 2009 7:52 pm    Post subject: Reply with quote

mike wrote:
Right now I am adding the force while it is static, maybe if I add the force as soon as it is no longer static that might help me out. Do you think that would make a difference?


Try setting:
world.allowSleep = false;
Back to top
View user's profile Send private message
mike



Joined: 28 Dec 2008
Posts: 34

PostPosted: Thu Apr 30, 2009 5:38 pm    Post subject: Reply with quote

Still kind of tough to tell but i think they are not acting as violent anymore.

Thanks.

I'll post the code and the final version in a few weeks. I entered the game in a competition that is near me. Wish me luck Wink.
Back to top
View user's profile Send private message
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Fri May 01, 2009 7:40 pm    Post subject: Reply with quote

mike wrote:
I'll post the code and the final version in a few weeks. I entered the game in a competition that is near me. Wish me luck Wink.


Good luck!
Back to top
View user's profile Send private message
mike



Joined: 28 Dec 2008
Posts: 34

PostPosted: Sat May 23, 2009 9:27 pm    Post subject: Reply with quote

I finished in 3rd place. Here is the completed project along with the source code. The exe file is located in the debug folder which is inside the bin folder http://dsource.org/projects/blockd


Again zzzzrrr thanks for all your help. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Blaze All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group