tweaks #4

Merged
cromer merged 9 commits from tweaks into develop 2022-04-09 21:51:22 -04:00
13 changed files with 43 additions and 43 deletions
Showing only changes of commit 756b42bf82 - Show all commits

View File

@ -24,10 +24,10 @@ godot-cpp-windows:
game: game-linux game-windows
game-linux:
scons use_llvm=$(USE_LLVM) target=$(RELEASE_TYPE) target_path=godot/gdnative/ target_name=libjuego platform=linux bits=64 -j $(PROCS)
scons use_llvm=$(USE_LLVM) target=$(RELEASE_TYPE) target_path=godot/gdnative/ target_name=libalai platform=linux bits=64 -j $(PROCS)
game-windows:
scons target=$(RELEASE_TYPE) target_name=libjuego target_path=godot/gdnative/ platform=windows bits=64 -j $(PROCS)
scons target=$(RELEASE_TYPE) target_name=libalai target_path=godot/gdnative/ platform=windows bits=64 -j $(PROCS)
docs:
# if doxygen and bear are installed create the code documentation

View File

@ -1,5 +1,5 @@
# Juego
# Alai
## License
[3-Clause BSD License](LICENSE)
[3-Clause BSD License](LICENSE)

View File

@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "juego"
PROJECT_NAME = "Alai"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version

View File

@ -1,6 +1,6 @@
[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://gdnative/libjuego.tres" type="GDNativeLibrary" id=1]
[ext_resource path="res://gdnative/libalai.tres" type="GDNativeLibrary" id=1]
[resource]
resource_name = "Main"

View File

@ -5,6 +5,5 @@
[node name="Main" type="Node"]
script = ExtResource( 1 )
launch_screen = 0
[node name="Level1" parent="." instance=ExtResource( 2 )]

View File

@ -1,6 +1,6 @@
[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://gdnative/libjuego.tres" type="GDNativeLibrary" id=1]
[ext_resource path="res://gdnative/libalai.tres" type="GDNativeLibrary" id=1]
[resource]
resource_name = "Player"

View File

@ -0,0 +1,7 @@
[gd_resource type="GDNativeLibrary" format=2]
[resource]
entry/Windows.64 = "res://gdnative/windows.64/libalai.dll"
entry/X11.64 = "res://gdnative/linux.64/libalai.so"
dependency/Windows.64 = [ ]
dependency/X11.64 = [ ]

View File

@ -1,7 +0,0 @@
[gd_resource type="GDNativeLibrary" format=2]
[resource]
entry/Windows.64 = "res://gdnative/windows.64/libjuego.dll"
entry/X11.64 = "res://gdnative/linux.64/libjuego.so"
dependency/Windows.64 = [ ]
dependency/X11.64 = [ ]

View File

@ -10,7 +10,8 @@ config_version=4
[application]
config/name="Juego"
config/name="Alai"
config/description="This game is for testing an Artificial Intelligence."
run/main_scene="res://Main.tscn"
config/icon="res://icon.png"

View File

@ -8,9 +8,9 @@ void Main::_register_methods()
{
register_method("_ready", &Main::_ready);
register_method("_physics_process", &Main::_physics_process);
register_property<Main, bool>("full_screen", &Main::set_full_screen, &Main::get_full_screen, JUEGO_MAIN_FULL_SCREEN);
register_property<Main, Vector2>("window_size", &Main::set_window_size, &Main::get_window_size, JUEGO_MAIN_WINDOW_SIZE);
register_property<Main, int8_t>("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, JUEGO_MAIN_LAUNCH_SCREEN);
register_property<Main, bool>("full_screen", &Main::set_full_screen, &Main::get_full_screen, ALAI_MAIN_FULL_SCREEN);
register_property<Main, Vector2>("window_size", &Main::set_window_size, &Main::get_window_size, ALAI_MAIN_WINDOW_SIZE);
register_property<Main, int8_t>("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, ALAI_MAIN_LAUNCH_SCREEN);
}
Main::Main()
@ -26,9 +26,9 @@ void Main::_init()
_os = OS::get_singleton();
_input = Input::get_singleton();
full_screen = JUEGO_MAIN_FULL_SCREEN;
window_size = JUEGO_MAIN_WINDOW_SIZE;
launch_screen = JUEGO_MAIN_LAUNCH_SCREEN;
full_screen = ALAI_MAIN_FULL_SCREEN;
window_size = ALAI_MAIN_WINDOW_SIZE;
launch_screen = ALAI_MAIN_LAUNCH_SCREEN;
}
void Main::_ready()

View File

@ -14,10 +14,10 @@ void Player::_register_methods()
register_method("_physics_process", &Player::_physics_process);
register_method("_on_Player_player_moved", &Player::_on_Player_player_moved);
//register_property<Player, Ref<SpriteFrames>>("sprite_frames", &Player::set_sprite_frames, &Player::get_sprite_frames, Ref<SpriteFrames>(), GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_DEFAULT, GODOT_PROPERTY_HINT_RESOURCE_TYPE, String("SpriteFrames"));
register_property<Player, float>("speed", &Player::set_speed, &Player::get_speed, JUEGO_PLAYER_SPEED);
register_property<Player, float>("jump_force", &Player::set_jump_force, &Player::get_jump_force, JUEGO_PLAYER_JUMP_FORCE);
register_property<Player, float>("gravity", &Player::set_gravity, &Player::get_gravity, JUEGO_PLAYER_GRAVITY);
register_property<Player, float>("run_speed", &Player::set_run_speed, &Player::get_run_speed, JUEGO_PLAYER_RUN_SPEED);
register_property<Player, float>("speed", &Player::set_speed, &Player::get_speed, ALAI_PLAYER_SPEED);
register_property<Player, float>("jump_force", &Player::set_jump_force, &Player::get_jump_force, ALAI_PLAYER_JUMP_FORCE);
register_property<Player, float>("gravity", &Player::set_gravity, &Player::get_gravity, ALAI_PLAYER_GRAVITY);
register_property<Player, float>("run_speed", &Player::set_run_speed, &Player::get_run_speed, ALAI_PLAYER_RUN_SPEED);
register_signal<Player>("player_moved", "position", GODOT_VARIANT_TYPE_VECTOR2);
}
@ -35,11 +35,11 @@ void Player::_init()
_input = Input::get_singleton();
_resource_loader = ResourceLoader::get_singleton();
//sprite_frames = _resource_loader->load(JUEGO_PLAYER_SPRITE_FRAMES);
set_speed(JUEGO_PLAYER_SPEED);
set_jump_force(JUEGO_PLAYER_JUMP_FORCE);
set_gravity(JUEGO_PLAYER_GRAVITY);
set_run_speed(JUEGO_PLAYER_RUN_SPEED);
//sprite_frames = _resource_loader->load(ALAI_PLAYER_SPRITE_FRAMES);
set_speed(ALAI_PLAYER_SPEED);
set_jump_force(ALAI_PLAYER_JUMP_FORCE);
set_gravity(ALAI_PLAYER_GRAVITY);
set_run_speed(ALAI_PLAYER_RUN_SPEED);
coins = 0;

View File

@ -1,5 +1,5 @@
#ifndef JUEGO_MAIN_H
#define JUEGO_MAIN_H
#ifndef ALAI_MAIN_H
#define ALAI_MAIN_H
#include <Godot.hpp>
#include <Node.hpp>
@ -9,17 +9,17 @@
/**
* @brief If the game should be full screen or not by default.
*/
#define JUEGO_MAIN_FULL_SCREEN false
#define ALAI_MAIN_FULL_SCREEN false
/**
* @brief The default size of the window.
* @details This is ignored if full screen is true.
*/
#define JUEGO_MAIN_WINDOW_SIZE Vector2(1280, 720)
#define ALAI_MAIN_WINDOW_SIZE Vector2(1280, 720)
/**
* @brief Which screen to launch the game on.
* @details If -1 it will launch the game on the "active" screen. Anything between 0 and N represents the screen number to show the game on when opened.
*/
#define JUEGO_MAIN_LAUNCH_SCREEN -1
#define ALAI_MAIN_LAUNCH_SCREEN -1
/**
* @brief This is the godot namespace for all the code included in the library.

View File

@ -1,26 +1,26 @@
#ifndef JUEGO_PLAYER_H
#define JUEGO_PLAYER_H
#ifndef ALAI_PLAYER_H
#define ALAI_PLAYER_H
/**
* @brief This resource is loaded by default for the AnimatedSprite node.
*/
#define JUEGO_PLAYER_SPRITE_FRAMES "res://characters/player/sprites/green.tres"
#define ALAI_PLAYER_SPRITE_FRAMES "res://characters/player/sprites/green.tres"
/**
* @brief The speed the player should move it.
*/
#define JUEGO_PLAYER_SPEED 60.0
#define ALAI_PLAYER_SPEED 60.0
/**
* @brief The force applied to the player when jumping.
*/
#define JUEGO_PLAYER_JUMP_FORCE 300.0
#define ALAI_PLAYER_JUMP_FORCE 300.0
/**
* @brief The gravity applied to the player.
*/
#define JUEGO_PLAYER_GRAVITY 9.81
#define ALAI_PLAYER_GRAVITY 9.81
/**
* @brief The multiplier used to change the speed of the player when running.
*/
#define JUEGO_PLAYER_RUN_SPEED 2.0
#define ALAI_PLAYER_RUN_SPEED 2.0
#include <Godot.hpp>
#include <KinematicBody2D.hpp>