mirror of
https://forge.univ-lyon1.fr/tplifap4/dungeonanddeamon.git
synced 2024-02-27 13:31:50 +01:00
76 lines
1.4 KiB
C++
76 lines
1.4 KiB
C++
#pragma once
|
|
#include "MobsCorpACorp.h"
|
|
#include "GestionPlayer.h"
|
|
#include "MobsIA.h"
|
|
#include <CircleShape2D.hpp>
|
|
#include <CollisionShape2D.hpp>
|
|
#include <Sprite.hpp>
|
|
#include "MobsCorpACorp.h"
|
|
#include <Node2D.hpp>
|
|
|
|
|
|
using namespace godot;
|
|
|
|
class MobsCorpACorpIA : public KinematicBody2D
|
|
{
|
|
|
|
public:
|
|
AnimatedSprite* sprite_MobsCorpACorp_ptr;
|
|
CollisionShape2D* collision_MobsCorpACorp_ptr;
|
|
|
|
Ref<Resource> texture_MobsCorpACorp_ptr;
|
|
Ref<CircleShape2D> shape_MobsCorpACorp_ptr;
|
|
|
|
private:
|
|
GODOT_CLASS(MobsCorpACorpIA, KinematicBody2D)
|
|
|
|
public:
|
|
MobsCorpACorp m;
|
|
|
|
public:
|
|
MobsCorpACorpIA();
|
|
|
|
void static _register_methods();
|
|
void _physics_process(float delta);
|
|
void _process(float delta);
|
|
void _init();
|
|
void _ready();
|
|
void animation();
|
|
|
|
private:
|
|
void droit();
|
|
void gauche();
|
|
void bas();
|
|
void saut();
|
|
void idle();
|
|
void attack();
|
|
|
|
void createMobsCorpACorp();
|
|
void setupMobsCorpACorp();
|
|
void mouvement(float dt);
|
|
|
|
|
|
|
|
|
|
public:
|
|
bool on_ground = false;
|
|
bool on_roof = false;
|
|
bool on_left_wall = false;
|
|
bool on_right_wall = false;
|
|
|
|
|
|
public:
|
|
void Action();
|
|
const float GamePlayMultiplicator = 100.0f;
|
|
float pv = 100.0f;
|
|
const float gravity = 9.8f * GamePlayMultiplicator;
|
|
const float speed = 50.f;
|
|
const float power_jump = -2.0f * GamePlayMultiplicator;
|
|
|
|
public:
|
|
Vector2 TargetPosition;
|
|
public:
|
|
void UpdateTargetPosition(Vector2 _TargetPosition) { TargetPosition = _TargetPosition; }
|
|
void setPosition(float x, float y);
|
|
};
|