Code formating

This commit is contained in:
2021-04-25 08:34:12 +02:00
committed by Valeriano A.R
parent 820f11e769
commit 4e62dbd35e
17 changed files with 316 additions and 312 deletions

View File

@@ -1,8 +1,8 @@
// Copyright (C) 2012 Valeriano Alfonso Rodriguez (Kableado)
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "GameLib.h"
extern int gamelib_debug;
@@ -40,7 +40,6 @@ void player_proc(Entity e, int ft) {
float jumpVel = 50.0f;
float airMovementFactor = 0.1f;
// Process elasticity
float entityScale[2];
Entity_GetScale(e, entityScale);
@@ -48,7 +47,6 @@ void player_proc(Entity e, int ft) {
entityScale[1] += (1.0f - entityScale[1]) / 2.0f;
Entity_SetScale(e, entityScale);
if (e->A > 0) {
if (Input_GetKey(InputKey_Jump) == InputKey_Pressed ||
Input_GetKey(InputKey_Up) == InputKey_Pressed) {
@@ -101,27 +99,29 @@ void player_proc(Entity e, int ft) {
e->A = 0;
}
void player_postproc(Entity e, int ft){
void player_postproc(Entity e, int ft) {
// Scroll View
GameLib_MoveToPos(e->pos, 0.6f);
//GameLib_MoveToPos(e->pos, 1.0f);
// GameLib_MoveToPos(e->pos, 1.0f);
}
int player_collision(Entity ent, Entity ent2, float t, vec2 n){
if(n[1] < 0 && fabs(n[1]) > fabs(n[0])){
int player_collision(Entity ent, Entity ent2, float t, vec2 n) {
if (n[1] < 0 && fabs(n[1]) > fabs(n[0])) {
ent->A = 1;
}
if (fabs(n[0]) > fabs(n[1])) {
float intensity = (fabs(ent->vel[0]) - 10.0f) / 40.0f;
if (intensity > 0) {
Entity_SetScale(ent, (float[2]){1.0f - (0.3f * intensity), 1.0f + (0.3f * intensity)});
Entity_SetScale(ent, (float[2]){1.0f - (0.3f * intensity),
1.0f + (0.3f * intensity)});
}
} else {
float intensity = (fabs(ent->vel[1]) - 10.0f) / 40.0f;
if (intensity > 0) {
Entity_SetScale(ent, (float[2]){1.0f + (0.3f * intensity), 1.0f - (0.3f * intensity)});
Entity_SetScale(ent, (float[2]){1.0f + (0.3f * intensity),
1.0f - (0.3f * intensity)});
}
}
return -1;

View File

@@ -3,7 +3,6 @@
#ifndef _GAMEENTS_H_
#define _GAMEENTS_H_
#define Ent_Player 1
#define Ent_Platform 2
#define Ent_Block 3

View File

@@ -1,9 +1,9 @@
// Copyright (C) 2012 Valeriano Alfonso Rodriguez (Kableado)
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "GameLib.h"

View File

@@ -3,9 +3,8 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <unistd.h>
#include "GameLib.h"
extern int gamelib_debug;