diff --git a/DungeonAndDeamon/.export/JeuxLIFAP5.dll b/DungeonAndDeamon/.export/JeuxLIFAP5.dll deleted file mode 100644 index ba05d89..0000000 Binary files a/DungeonAndDeamon/.export/JeuxLIFAP5.dll and /dev/null differ diff --git a/DungeonAndDeamon/.export/roguelike.exe b/DungeonAndDeamon/.export/roguelike.exe deleted file mode 100644 index d4f375c..0000000 Binary files a/DungeonAndDeamon/.export/roguelike.exe and /dev/null differ diff --git a/DungeonAndDeamon/.export/roguelike.pck b/DungeonAndDeamon/.export/roguelike.pck deleted file mode 100644 index e971893..0000000 Binary files a/DungeonAndDeamon/.export/roguelike.pck and /dev/null differ diff --git a/DungeonAndDeamon/.script/JeuxLIFAP5.dll b/DungeonAndDeamon/.script/JeuxLIFAP5.dll deleted file mode 100644 index 9ea656f..0000000 Binary files a/DungeonAndDeamon/.script/JeuxLIFAP5.dll and /dev/null differ diff --git a/DungeonAndDeamon/.script/JeuxLIFAP5.exp b/DungeonAndDeamon/.script/JeuxLIFAP5.exp deleted file mode 100644 index c0cb4d2..0000000 Binary files a/DungeonAndDeamon/.script/JeuxLIFAP5.exp and /dev/null differ diff --git a/DungeonAndDeamon/.script/JeuxLIFAP5.lib b/DungeonAndDeamon/.script/JeuxLIFAP5.lib deleted file mode 100644 index d6b7756..0000000 Binary files a/DungeonAndDeamon/.script/JeuxLIFAP5.lib and /dev/null differ diff --git a/DungeonAndDeamon/JeuxLIFAP5.dll b/DungeonAndDeamon/JeuxLIFAP5.dll deleted file mode 100644 index ba05d89..0000000 Binary files a/DungeonAndDeamon/JeuxLIFAP5.dll and /dev/null differ diff --git a/DungeonAndDeamon/script/KinematicBody2D.gdns b/DungeonAndDeamon/script/KinematicBody2D.gdns deleted file mode 100644 index 9029ccd..0000000 --- a/DungeonAndDeamon/script/KinematicBody2D.gdns +++ /dev/null @@ -1,8 +0,0 @@ -[gd_resource type="NativeScript" load_steps=2 format=2] - -[ext_resource path="res://script/TestJeuxGDN.gdnlib" type="GDNativeLibrary" id=1] - -[resource] -resource_name = "Player" -class_name = "Player" -library = ExtResource( 1 ) diff --git a/DungeonAndDeamon/script/Node2D.tscn b/DungeonAndDeamon/script/Node2D.tscn index 25afa88..23e80ad 100644 --- a/DungeonAndDeamon/script/Node2D.tscn +++ b/DungeonAndDeamon/script/Node2D.tscn @@ -91,14 +91,9 @@ animations = [ { "name": "idle", "speed": 5.0 }, { -"frames": [ ExtResource( 13 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 14 ), ExtResource( 12 ), ExtResource( 15 ), ExtResource( 21 ), ExtResource( 18 ), ExtResource( 20 ), ExtResource( 19 ) ], +"frames": [ ExtResource( 53 ), ExtResource( 62 ), ExtResource( 43 ), ExtResource( 51 ) ], "loop": true, -"name": "run", -"speed": 5.0 -}, { -"frames": [ ExtResource( 56 ), ExtResource( 48 ), ExtResource( 44 ), ExtResource( 34 ), ExtResource( 54 ), ExtResource( 35 ), ExtResource( 49 ), ExtResource( 46 ), ExtResource( 47 ) ], -"loop": true, -"name": "mort", +"name": "degat", "speed": 5.0 }, { "frames": [ ExtResource( 45 ), ExtResource( 41 ), ExtResource( 42 ), ExtResource( 63 ), ExtResource( 58 ), ExtResource( 59 ), ExtResource( 40 ), ExtResource( 55 ), ExtResource( 36 ) ], @@ -106,21 +101,16 @@ animations = [ { "name": "attack02", "speed": 5.0 }, { +"frames": [ ExtResource( 13 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 14 ), ExtResource( 12 ), ExtResource( 15 ), ExtResource( 21 ), ExtResource( 18 ), ExtResource( 20 ), ExtResource( 19 ) ], +"loop": true, +"name": "run", +"speed": 5.0 +}, { "frames": [ ExtResource( 71 ), ExtResource( 66 ), ExtResource( 67 ), ExtResource( 72 ), ExtResource( 74 ), ExtResource( 77 ), ExtResource( 80 ), ExtResource( 79 ), ExtResource( 75 ) ], "loop": true, "name": "roulade", "speed": 5.0 }, { -"frames": [ ExtResource( 53 ), ExtResource( 62 ), ExtResource( 43 ), ExtResource( 51 ) ], -"loop": true, -"name": "degat", -"speed": 5.0 -}, { -"frames": [ ExtResource( 33 ), ExtResource( 38 ), ExtResource( 33 ), ExtResource( 39 ), ExtResource( 38 ), ExtResource( 50 ) ], -"loop": true, -"name": "fall", -"speed": 5.0 -}, { "frames": [ ExtResource( 65 ), ExtResource( 81 ), ExtResource( 76 ), ExtResource( 70 ), ExtResource( 68 ) ], "loop": true, "name": "degat shield", @@ -131,15 +121,25 @@ animations = [ { "name": "attack01", "speed": 5.0 }, { -"frames": [ ExtResource( 57 ), ExtResource( 52 ), ExtResource( 69 ), ExtResource( 64 ), ExtResource( 78 ), ExtResource( 73 ), ExtResource( 65 ) ], +"frames": [ ExtResource( 33 ), ExtResource( 38 ), ExtResource( 33 ), ExtResource( 39 ), ExtResource( 38 ), ExtResource( 50 ) ], "loop": true, -"name": "shield", +"name": "fall", +"speed": 5.0 +}, { +"frames": [ ExtResource( 56 ), ExtResource( 48 ), ExtResource( 44 ), ExtResource( 34 ), ExtResource( 54 ), ExtResource( 35 ), ExtResource( 49 ), ExtResource( 46 ), ExtResource( 47 ) ], +"loop": true, +"name": "mort", "speed": 5.0 }, { "frames": [ ExtResource( 37 ), ExtResource( 60 ), ExtResource( 61 ), ExtResource( 50 ), ExtResource( 38 ), ExtResource( 33 ), ExtResource( 39 ) ], "loop": true, "name": "jump", "speed": 5.0 +}, { +"frames": [ ExtResource( 57 ), ExtResource( 52 ), ExtResource( 69 ), ExtResource( 64 ), ExtResource( 78 ), ExtResource( 73 ), ExtResource( 65 ) ], +"loop": true, +"name": "shield", +"speed": 5.0 } ] [node name="Stageone" type="Node2D"] @@ -173,6 +173,7 @@ shape = SubResource( 1 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="Player"] frames = SubResource( 2 ) animation = "fall" +frame = 5 playing = true [node name="TileMap" type="TileMap" parent="."] diff --git a/DungeonAndDeamon/script/Player.gdns b/DungeonAndDeamon/script/Player.gdns index 91d0f8c..65242c0 100644 --- a/DungeonAndDeamon/script/Player.gdns +++ b/DungeonAndDeamon/script/Player.gdns @@ -1,7 +1,7 @@ [gd_resource type="NativeScript" load_steps=2 format=2] [sub_resource type="GDNativeLibrary" id=1] -entry/Windows.64 = "res://.script/JeuxLIFAP5.dll" +entry/Windows.64 = "res://Dungeonanddemon.dll" dependency/Windows.64 = [ ] [resource] diff --git a/DungeonAndDeamon/script/TestJeuxGDN.gdnlib b/DungeonAndDeamon/script/TestJeuxGDN.gdnlib deleted file mode 100644 index abeb6a5..0000000 --- a/DungeonAndDeamon/script/TestJeuxGDN.gdnlib +++ /dev/null @@ -1,14 +0,0 @@ -[entry] - -Windows.64="res://JeuxLIFAP5.dll" - -[dependencies] - -Windows.64=[ ] - -[general] - -singleton=false -load_once=true -symbol_prefix="godot_" -reloadable=true diff --git a/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionPlayer.cpp b/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionPlayer.cpp index c61db8b..5f78612 100644 --- a/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionPlayer.cpp +++ b/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionPlayer.cpp @@ -1,25 +1,71 @@ #include "GestionPlayer.h" -void GestionPlayer::droit() -{ +#include "GestionPlayer.h" + + + +using namespace godot; + +void Player::_register_methods() { + register_method((char*)"_process", &Player::_process); } -void GestionPlayer::gauche() -{ +void Player::_init() {} + +Player::Player() { + velocity = Vector2(0, 0); } -void GestionPlayer::bas() +Player::~Player() {} + +void Player::_process(float delta) { + + UpdateMotionFromInput(); + + velocity = move_and_slide(velocity, FLOOR); } -void GestionPlayer::saut() +void Player::UpdateMotionFromInput() { + velocity = Vector2(0, 0); + FLOOR = Vector2(0, -1); + + + Input* i = Input::get_singleton(); + + if (i->is_action_pressed("ui_left")) + { + + velocity.x -= speed; + void play(String anim = "run", bool backwards = false); + + + } + + + + else if (i->is_action_pressed("ui_right")) + velocity.x += speed; + else + velocity.x = 0.0; + + if (i->is_action_pressed("ui_select")) { + if (on_ground == true) { + velocity.y = power_jump; + on_ground = false; + } + } + + + + if (is_on_floor()) { + on_ground = true; + velocity.y += 0; + } + else { + on_ground = false; + velocity.y += gravity; + } } -void GestionPlayer::idle() -{ -} - -void GestionPlayer::attack() -{ -} diff --git a/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionPlayer.h b/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionPlayer.h index 226a73b..20cda05 100644 --- a/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionPlayer.h +++ b/DungeonAndDeamonScript/DungeonAndDemaonScript/GestionPlayer.h @@ -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 +#include +#include + +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(); }; diff --git a/GodoBinding/include/gen/.gitignore b/GodoBinding/include/gen/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/GodoBinding/include/gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore