0

I'm trying to make a small game where a man shoots "bullets" (which are just circles). I have attempted to make it so when someone drags the mouse, multiple circles will spawn. Currently, the circles only travel when the mouse is released. I added a for loop so when I drag the mouse, 30 circles will spawn (clip size) - but when I test it, the circles may spawn, but the circle only stays next to the man until I release the mouse.

if(drag == true)
{
    for(int i = 0; i < 30; i++)
    {
        gl::color(Color(0, 0, 0));
        gl::drawSolidCircle(Vec2f(x, y), 2);
        gl::color(Color(1, 1, 1));
    }
}

This is my first time creating a game with c++ or cinder, so sorry if I missed something obvious (simply put, I'm very noobish at coding). Thanks in advance!

4

1 回答 1

0

您在寻找MouseDrag()活动吗?

http://libcinder.org/docs/v0.8.3/classcinder_1_1app_1_1_app.html#a951b397345f8014100cbfd1fc96896b0

于 2014-08-01T04:19:54.540 回答