Canvas question: Bullets drawing over each other.

0 favourites
  • 7 posts
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • Hi!

    I'm trying to make a visual tunnel effect by drawing lines of color between 3 bullets that move from the center of the screen and outward. I want every new bullet to draw over the previous one, but can't find a way to do that. Please help!

  • change every 1 second to 0.1 or 0.2 seconds. that should do it. but it might be to CPU intensive... "thread" carefully

  • change every 1 second to 0.1 or 0.2 seconds. that should do it. but it might be to CPU intensive... "thread" carefully

    I think maybe I didn't explain what I meant properly. I want the lines that the new bullets draw to overwrite the previous ones. And maybe change line color with each new line. To create a rainbow effect that I can modify further in the process.

  • The sprites themselves are just there for debugging purposes.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • > change every 1 second to 0.1 or 0.2 seconds. that should do it. but it might be to CPU intensive... "thread" carefully

    I think maybe I didn't explain what I meant properly. I want the lines that the new bullets draw to overwrite the previous ones. And maybe change line color with each new line. To create a rainbow effect that I can modify further in the process.

    ahh i see you want the colors to change while redraws... well for that you have to change those RGB colors i think so lets say you have a max value of a color at 255 for red would be RGBA (255,0,0,1) and for GReen and blue the same 255 but in their respective RGB order.

    now you can do try this and see what happens

    you can try to count if Red Green or Blue reached 255... since we will increment all at 1 time the same speed so we have that rainbow psychedelic seizure inducing effect.

    Red < 255 add to RED 1 # add to Green 1 # add to Blue 1

    Red >= 255 set RED to 0 # GREEN to 0 # BLUE to 0

    this way you always loop the colors you can run this before your drawing on the everytick

    it should overlap or atleast be at the edge of each other based on your drawing updates, to overlap them you have to also move the XY position a certain distance so when you draw that from sprite 1 to 2 you can also make all the debug dots move since you are using them as drawing position i guess?

    hope it makes sense. il try put together a example file but im a bit color sensitive cause is like 12 am here and didn't slept.

    but to get that effect you have to move the XY and color values in a loop for sure.

  • Thanks for your response! I am getting closer to where I want it, but not quite there yet. Right now, the triangles drawn are staying the same in the center, while changing color outward. I want them to pulsate from the center, new colors emerging from within.

    Here is my project file testing out your rgb changing suggestion kinda.

    drive.google.com/file/d/1Btz5MxeV6yfrHrIrOCmWf8HyePxA7sWM/view

    I didn't understand what you meant by moving the XY position.

  • I think there is a solution involving the pick action where I pick the last created sprite instance and assign stuff to it, but I don't know what lol. I'll keep trying.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)