draw a small gun that can move back and forth along the bottom of the canvas?

edited March 2018 in How To...

draw a small “gun” that can move back and forth along the bottom of the canvas that can fire bullets when mouse is pressed , shooting letters on top of the canvas that have all 26 just moving like an electric billboard, after shooting any of these letters, the letters come underneath the gun in a separate section.

Answers

  • Alright. So what code do you have already?

  • none right now

  • edited March 2018

    Well, attempt some. Do you know how setup() and draw() work? Do you know how to specify a position to draw a rect(), ellipse(), or triangle()? Can you use variables for the position? How about drawing some text()? How are you remebering where the bullets are? Can you put the code for what needs to happen when the mouse is pressed inside the mousePressed() function? Are you storing the positions of things in arrays? Maybe you can write a class for each type of object?

    There's a lot to do here... and you need to attempt it yourself first. Post the code of your attempt for more help.

  • will do

Sign In or Register to comment.