Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
how to use CCD(bodyDef -> bullet), and Gideros Nameing Bug Report. - Gideros Forum

how to use CCD(bodyDef -> bullet), and Gideros Nameing Bug Report.

blackheartblackheart Member
edited June 2012 in General questions
hi , i have a two question.

First,
I'm using box2d
and making game. It has a very fast object
So I'm going to use bullet.
example,

local radius = 30
player = world:createBody{type = b2.DYNAMIC_BODY, bullet = true}
player:setPosition(50, 50)
local circle = b2.CircleShape.new(0, 0, radius)
player:createFixture{shape = circle}

that is. And the file attachment.
but, Objects that are still passing through the wall.

i think because it's frame based event. but i want to use bullet property.
Or Is there another way that does not pass through walls?
As players control the physical body does not go through walls, I would like to know how to.

Second,

In Gideros, file or folder naming.
I was used as a prefix "_"
for example

_Libs
_Images
_Sounds
_GameScene.lua
_Player.lua
_Config.lua
...

That is.
it's not problem on iPhone
but export on eclipse and compiler output error !


What is the problem? Please answer : )
ps. i'm Korean, So my English is Terrible. Thank you for your understanding.
zip
zip
TestSlowMotion.zip
4K

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Well, the problem is, that you are simply dragging the body, by changing it's coordinates to touch coordinates.

    Here is an example (including example project) on how to properly drag box2d object.
    http://appcodingeasy.com/Gideros-Mobile/Dragging-Box2d-object-in-Gideros-Mobile

    You can increase restitution to see that increasing speed of object, will not make it pass through bounding walls.

    About the second one it might be the specific of Eclipse or android project, can't tell you that. But you can always rename your files :)
  • I found this topic while searching for a solution to a similar problem: after creating a body with the bullet attribute set to true, the body still passed through other objects.

    Sorry to post to an old (and solved, by the look of it) thread, but just to add my experience here, I solved my problem using the body:setBullet(true), instead of setting the attribute while creating the body. A bug, maybe?
  • atilimatilim Maintainer
    edited February 2013
    This code worked well on my side:
    require "box2d"
     
    local world = b2.World.new(0, 0)
    local body = world:createBody({bullet = true})
    print(body:isBullet())
    Do you create your body in a similar way?
  • Wow, sometimes we can really let things pass unoticed...
    I was going to paste the relevant part of the code, and just realized I was setting the bullet attribute when creating the fixture, not the body... now it works normally! :-\"
Sign In or Register to comment.