mirror of
https://forge.univ-lyon1.fr/tplifap4/dungeonanddeamon.git
synced 2024-02-27 13:31:50 +01:00
modif ennemie et tentative de mouvement
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include <Input.hpp>
|
||||
#include <ResourceLoader.hpp>
|
||||
#include <Texture.hpp>
|
||||
#include "MobsCorpACorp.h"
|
||||
|
||||
MobsCorpACorpIA::MobsCorpACorpIA()
|
||||
{
|
||||
@ -28,6 +29,7 @@ void MobsCorpACorpIA::_register_methods()
|
||||
|
||||
void MobsCorpACorpIA::_process(float delta)
|
||||
{
|
||||
m.velocity = move_and_slide(m.velocity);
|
||||
}
|
||||
|
||||
void MobsCorpACorpIA::_init()
|
||||
@ -51,19 +53,7 @@ void MobsCorpACorpIA::_ready()
|
||||
|
||||
void MobsCorpACorpIA::setupMobsCorpACorp()
|
||||
{
|
||||
Transform2D t;
|
||||
Vector2 v;
|
||||
Size2 s;
|
||||
|
||||
//setup de la size
|
||||
s.x = 1;
|
||||
s.y = 1;
|
||||
v.x = 500;
|
||||
v.y = 10;
|
||||
t.set_origin(v);
|
||||
t.scale(s);
|
||||
|
||||
set_transform(t);
|
||||
|
||||
//Setup du shape
|
||||
Godot::print("SetUp de Shape Mobs");
|
||||
@ -83,3 +73,27 @@ void MobsCorpACorpIA::setupMobsCorpACorp()
|
||||
}
|
||||
|
||||
|
||||
void MobsCorpACorpIA::setPosition(int x, int y)
|
||||
{
|
||||
Transform2D t;
|
||||
Vector2 v;
|
||||
Size2 s;
|
||||
|
||||
//setup de la size
|
||||
s.x = 1;
|
||||
s.y = 1;
|
||||
v.x = x;
|
||||
v.y = y;
|
||||
t.set_origin(v);
|
||||
t.scale(s);
|
||||
|
||||
set_transform(t);
|
||||
}
|
||||
|
||||
void MobsCorpACorpIA::mouvement()
|
||||
{
|
||||
m.velocity = Vector2(0, 0);
|
||||
m.velocity.y += gravity;
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user