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!

neminem
  • 2,658
  • 5
  • 27
  • 36

1 Answers1

0

Are you looking for the MouseDrag() event?

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

dhganey
  • 113
  • 1
  • 6
  • I already have mouse drag. 'void shootingmanApp::mouseDrag( MouseEvent event) { dragX = event.getX(); dragY = event.getY(); drag = true; }' I just can't get it to work so that the circles are separate and move instread of just staying by the man until I let go of the mouse. Thanks though. – HardlyFlaccid Aug 01 '14 at 15:26