Updated canvas size
This commit is contained in:
1 file changed
+2
-3
+2
-3
@@ -2,7 +2,6 @@
|
|||||||
#include "objects.h"
|
#include "objects.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
Vector2 body_collision(mass_body_t *a, mass_body_t *b) {
|
Vector2 body_collision(mass_body_t *a, mass_body_t *b) {
|
||||||
Vector2 diff = vec2_diff(&a->position, &b->position);
|
Vector2 diff = vec2_diff(&a->position, &b->position);
|
||||||
float len = vec2_len(diff);
|
float len = vec2_len(diff);
|
||||||
@@ -49,8 +48,8 @@ void collide(mass_body_t *a, mass_body_t *b, const Vector2 *normal,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void collide_rigid(mass_body_t *a, float restitution) {
|
void collide_rigid(mass_body_t *a, float restitution) {
|
||||||
float max_x = GetRenderWidth() / 2.0f - a->radius;
|
float max_x = GetRenderWidth() * 10 / 2.0f - a->radius;
|
||||||
float max_y = GetRenderHeight() / 2.0f - a->radius;
|
float max_y = GetRenderHeight() * 10 / 2.0f - a->radius;
|
||||||
|
|
||||||
if (a->position.x > max_x) {
|
if (a->position.x > max_x) {
|
||||||
a->position.x = max_x;
|
a->position.x = max_x;
|
||||||
|
|||||||
Reference in new issue
Block a user