mirror of
https://forge.univ-lyon1.fr/tplifap4/dungeonanddeamon.git
synced 2024-02-27 13:31:50 +01:00
ajustement godot
This commit is contained in:
@ -1,17 +1,59 @@
|
||||
#pragma once
|
||||
#include "Player.h"
|
||||
|
||||
class GestionPlayer
|
||||
{
|
||||
public:
|
||||
Player p;
|
||||
#pragma once
|
||||
|
||||
public:
|
||||
void droit();
|
||||
void gauche();
|
||||
void bas();
|
||||
void saut();
|
||||
void idle();
|
||||
void attack();
|
||||
#include <Godot.hpp>
|
||||
#include <KinematicBody2D.hpp>
|
||||
#include <Input.hpp>
|
||||
|
||||
namespace godot {
|
||||
class Player : public KinematicBody2D
|
||||
{
|
||||
|
||||
// Godot structure
|
||||
private:
|
||||
GODOT_CLASS(Player, KinematicBody2D)
|
||||
public:
|
||||
static void _register_methods();
|
||||
void _init();
|
||||
void _process(float delta);
|
||||
|
||||
Player();
|
||||
~Player();
|
||||
|
||||
|
||||
// Gameplay variables
|
||||
public:
|
||||
|
||||
const int speed = 100;
|
||||
const int gravity = 90;
|
||||
const int power_jump = -2500;
|
||||
bool on_ground = false;
|
||||
bool right;
|
||||
bool left;
|
||||
bool jump;
|
||||
|
||||
|
||||
private:
|
||||
Vector2 velocity;
|
||||
Vector2 FLOOR;
|
||||
|
||||
|
||||
|
||||
// Gameplay methods
|
||||
public:
|
||||
void UpdateMotionFromInput();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
attack();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user