LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

How to make a motion border for sprites with if statments?

Root / Programming Questions / [.]

Techster14Created:
Ok, thanks

Now about that collision system...

A: the edit button is your friend B: if x1+w1>x2 and x1<x2+w2 and y1+h1>y2 and y1<y2+h2

Wdymb the edit button is your friend? It's literally the only place I program xD

I meant for forum posts.

Oh ok

A: the edit button is your friend B: if x1+w1>x2 and x1<x2+w2 and y1+h1>y2 and y1<y2+h2
Is this for the collision? It seems like code for the border thing.

That is code for the collision between two rectangles, rect1 being x1,y1,w1, and h1, which rect2 being x2,y2,w2, and h2. x and y are the x and y positions of each rect, and w and h are the width and height of each rect.

A: the edit button is your friend B: if x1+w1>x2 and x1<x2+w2 and y1+h1>y2 and y1<y2+h2
Is this for the collision? It seems like code for the border thing.
It is worth noting that it will work for both border detection and bounding-box collision.

So to use the given parameters, object1 is a diamond and object2 is a flame, obj1xywh(16,16,9,13) and obj2xywh(32,32,9,13), given these theoretical values, should my code be:
if 16+9>32 and 16<32+9 and 16+13>32 and 16<32+13

Yes.