Sample: RPG: Init
11
Samples/SpaceCase/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
set(SRC_FILES
|
||||
"Src/Imp/CPP/Game.cpp"
|
||||
)
|
||||
|
||||
add_library(Game SHARED ${SRC_FILES})
|
||||
|
||||
target_compile_definitions(Game PRIVATE "__BUILDING_IAENGINE_GAME=1")
|
||||
|
||||
target_include_directories(Game PRIVATE "Src/Imp/HPP")
|
||||
|
||||
target_link_libraries(Game PUBLIC IAEngine)
|
||||
1
Samples/SpaceCase/Resources/Sprites/LICENCE
Normal file
@ -0,0 +1 @@
|
||||
Shout out to Anim86 for this amazing sprite pack! https://anim86.itch.io/space-shoter-starter-pack
|
||||
BIN
Samples/SpaceCase/Resources/Sprites/SpaceShip.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/Stars-A.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/Stars-B.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/bg.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/bonus_life.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/bonus_shield.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/bonus_time.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/bullet-1.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/bullet-2.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/bullet.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/fire.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/insect-1.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/insect-2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/large-A.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/large-B.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/laser-1.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/laser-2.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/laser-3.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/medium-A.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/medium-B.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/plasm.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/rocket.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/shield.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/small-A.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/small-B.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
Samples/SpaceCase/Resources/Sprites/support.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
Samples/SpaceCase/Resources/UI/Button.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
Samples/SpaceCase/Resources/UI/Title.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
92
Samples/SpaceCase/Src/Imp/CPP/Game.cpp
Normal file
@ -0,0 +1,92 @@
|
||||
// IAEngine: 2D Game Engine by IA
|
||||
// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include <Game.hpp>
|
||||
|
||||
RefPtr<Node2D> backgroundNode;
|
||||
RefPtr<CameraNode> mainCamera;
|
||||
|
||||
TextureComponent *title;
|
||||
|
||||
C_DECL(IA_DLL_EXPORT GameRequestedConfig Game_GetConfigRequest())
|
||||
{
|
||||
return {600, 600};
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnInitialize())
|
||||
{
|
||||
mainCamera = MakeRefPtr<CameraNode>("MainCamera");
|
||||
Engine::SetActiveCamera(mainCamera->GetCameraComponent());
|
||||
|
||||
Engine::CreateImageFromFile("Background", "Resources/Sprites/bg.png");
|
||||
Engine::CreateImageFromFile("Stars-A", "Resources/Sprites/Stars-A.png");
|
||||
Engine::CreateImageFromFile("Stars-B", "Resources/Sprites/Stars-B.png");
|
||||
Engine::CreateImageFromFile("Title", "Resources/UI/Title.png");
|
||||
|
||||
//UI::SetHTML("<img src=\"Resources/UI/Title.png\" style=\"width: 100%; height: 100%;\"></img>");
|
||||
//backgroundNode = MakeRefPtr<Node2D>("BG");
|
||||
//backgroundNode->AddComponent<TextureComponent>()->SetTexture(Engine::GetImage("Background"));
|
||||
//title = backgroundNode->AddComponent<TextureComponent>();
|
||||
//title->PositionOffset() = {150, 100};
|
||||
//title->SetTexture(Engine::GetImage("Title"));
|
||||
//Engine::AddNodeToActiveScene(backgroundNode);
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnTerminate())
|
||||
{
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnDebugDraw())
|
||||
{
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnFixedUpdate())
|
||||
{
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnUpdate(IN FLOAT32 deltaTime))
|
||||
{
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT VOID Game_OnResize(IN INT32 newWidth, IN INT32 newHeight))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT PCCHAR Game_GetName())
|
||||
{
|
||||
return "Space Case";
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT UINT64 Game_GetVersion())
|
||||
{
|
||||
return IA_MAKE_VERSION(1, 0, 0);
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT PCCHAR Game_GetPackageName())
|
||||
{
|
||||
return "com.iasoft.spacecase";
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT PCCHAR Game_GetDeveloperName())
|
||||
{
|
||||
return "IASoft (PVT) LTD";
|
||||
}
|
||||
|
||||
C_DECL(IA_DLL_EXPORT PCCHAR Game_GetPublisherName())
|
||||
{
|
||||
return "IASoft (PVT) LTD";
|
||||
}
|
||||
20
Samples/SpaceCase/Src/Imp/HPP/Game.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
// IAEngine: 2D Game Engine by IA
|
||||
// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <IAEngine/GameLibraryInterface.hpp>
|
||||
|
||||