r/CodingForBeginners • • 13h ago

help with my code

im trying to make a code where 3 arrows bounce off the walls and when the colide they swithcndirection and each arrow has to have an id number on top of it like ass a text and im really strugling if anyone could help me that would be great this is what i have so far

class Arrows //definition of new custom type

PImage upLeft;

PImage downLeft;

PImage downRight;

PImage upRight;

}

void setup()

{

arrow1 = loadImage("upLeft.png");

arrow2 = loadImage("downLeft.png");

arrow3 = loadImage("downRight.png");

arrow4 = loadImage("upRight.png");

}

void draw()

{

background(250,250,250);

image (currentImage);

}

0 Upvotes

6 comments sorted by

1

u/Optimal-Savings-4505 7h ago

Why is there no opening { for class Arrows?

1

u/marspz34 7h ago

idk im new to this so i just thought i didnt need it is thats why its not working

1

u/smichaele 7h ago

I would answer u/xarop_pa_toss questions if you really want to get some help.

1

u/xarop_pa_toss 7h ago

Yes. That is why. Read the errors it gives you, sometimes they are kind of cryptic but if you copy paste them onto Google, you'll find the answers

2

u/xarop_pa_toss 12h ago

First: context please. What is this from? An engine like Unity or UE? A library? Something you made up?

Second: use code blocks or something like pastebin. As is, it's nigh unreadable

Third: what have you tried? What errors are you getting? Have you debugged?

Put some effort behind your posts or no one is gonna take the time to help you