mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-04-29 03:04:42 +00:00
Merge pull request #73 from QuasarApp/task_72
Refactoring: refactoring and move resource file absLvl.
This commit is contained in:
commit
073a8ad7ca
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -13,3 +13,6 @@
|
|||||||
[submodule "src/CrawlTestLvl/CrawlTestLvlAssets"]
|
[submodule "src/CrawlTestLvl/CrawlTestLvlAssets"]
|
||||||
path = src/CrawlTestLvl/CrawlTestLvlAssets
|
path = src/CrawlTestLvl/CrawlTestLvlAssets
|
||||||
url = ssh://web@quasarapp.ddns.net:2022/QuasarApp/CrawlTestLvlAssets.git
|
url = ssh://web@quasarapp.ddns.net:2022/QuasarApp/CrawlTestLvlAssets.git
|
||||||
|
[submodule "src/CrawlAbstractLvl/CrawlAbstractLevelAssets"]
|
||||||
|
path = src/CrawlAbstractLvl/CrawlAbstractLevelAssets
|
||||||
|
url = ssh://web@quasarapp.ddns.net:2022/QuasarApp/CrawlAbstractLevelAssets.git
|
||||||
|
@ -65,6 +65,7 @@ add_subdirectory(submodules/ViewSolutions)
|
|||||||
|
|
||||||
add_subdirectory(src/Core)
|
add_subdirectory(src/Core)
|
||||||
add_subdirectory(src/CrawlTestLvl)
|
add_subdirectory(src/CrawlTestLvl)
|
||||||
|
add_subdirectory(src/CrawlAbstractLvl)
|
||||||
|
|
||||||
add_subdirectory(src/Client)
|
add_subdirectory(src/Client)
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ else()
|
|||||||
add_executable(${CURRENT_PROJECT} ${SOURCE_CPP})
|
add_executable(${CURRENT_PROJECT} ${SOURCE_CPP})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${CURRENT_PROJECT} PUBLIC ${PROJECT_NAME}Core TestLvl)
|
target_link_libraries(${CURRENT_PROJECT} PUBLIC ${PROJECT_NAME}Core TestLvl AbstractLvl)
|
||||||
|
|
||||||
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
|
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
|
||||||
target_include_directories(${CURRENT_PROJECT} PRIVATE ${PRIVATE_INCUDE_DIR})
|
target_include_directories(${CURRENT_PROJECT} PRIVATE ${PRIVATE_INCUDE_DIR})
|
||||||
@ -37,6 +37,7 @@ file(MAKE_DIRECTORY ${TARGET_DIR})
|
|||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(SNAKE_EXTRA_LIBS "${PROJECT_NAME}Core"
|
set(SNAKE_EXTRA_LIBS "${PROJECT_NAME}Core"
|
||||||
TestLvl
|
TestLvl
|
||||||
|
AbstractLvl
|
||||||
QuasarApp
|
QuasarApp
|
||||||
QmlNotyfyService
|
QmlNotyfyService
|
||||||
ViewSolutions)
|
ViewSolutions)
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.1">
|
<TS version="2.1">
|
||||||
|
<context>
|
||||||
|
<name>AbsLvlWorld</name>
|
||||||
|
<message>
|
||||||
|
<source>This a abstract lvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AbstractLvl</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>Crawl</name>
|
<name>Crawl</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <Crawl/clientapp.h>
|
#include <Crawl/clientapp.h>
|
||||||
#include <testlvl.h>
|
#include <testlvl.h>
|
||||||
|
#include <abstractlvl.h>
|
||||||
#include <quasarapp.h>
|
#include <quasarapp.h>
|
||||||
|
|
||||||
void initLang() {
|
void initLang() {
|
||||||
@ -38,6 +39,7 @@ int main(int argc, char *argv[])
|
|||||||
CRAWL::ClientApp client;
|
CRAWL::ClientApp client;
|
||||||
|
|
||||||
client.registerLevel<TestLvl>();
|
client.registerLevel<TestLvl>();
|
||||||
|
client.registerLevel<AbstractLvl>();
|
||||||
|
|
||||||
if (!client.init(&engine)) {
|
if (!client.init(&engine)) {
|
||||||
return 1;
|
return 1;
|
||||||
|
14
src/CrawlAbstractLvl/AbsLvlControl.qml
Normal file
14
src/CrawlAbstractLvl/AbsLvlControl.qml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
import CrawlModule 1.0
|
||||||
|
import QtQuick.Layouts 1.15
|
||||||
|
|
||||||
|
DefaultMenu {
|
||||||
|
|
||||||
|
}
|
5
src/CrawlAbstractLvl/AbstractLvl.qrc
Normal file
5
src/CrawlAbstractLvl/AbstractLvl.qrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/qml">
|
||||||
|
<file>AbsLvlControl.qml</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
33
src/CrawlAbstractLvl/CMakeLists.txt
Normal file
33
src/CrawlAbstractLvl/CMakeLists.txt
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
# of this license document, but changing it is not allowed.
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
set(CURRENT_PROJECT "AbstractLvl")
|
||||||
|
|
||||||
|
add_definitions(-DCRAWL_ABSTRACT_LEVEL_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
|
file(GLOB SOURCE_CPP
|
||||||
|
"*.cpp"
|
||||||
|
"private/*.cpp"
|
||||||
|
"*.qrc"
|
||||||
|
"private/*.qrc"
|
||||||
|
"CrawlAbstractLevelAssets/*.qrc"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set(PRIVATE_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/private")
|
||||||
|
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ../Client/modules)
|
||||||
|
|
||||||
|
add_library(${CURRENT_PROJECT} ${SOURCE_CPP} ${SOURCE_QRC})
|
||||||
|
|
||||||
|
target_link_libraries(${CURRENT_PROJECT} PUBLIC ${PROJECT_NAME}Core)
|
||||||
|
|
||||||
|
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
|
||||||
|
target_include_directories(${CURRENT_PROJECT} PRIVATE ${PRIVATE_INCUDE_DIR})
|
||||||
|
|
1
src/CrawlAbstractLvl/CrawlAbstractLevelAssets
Submodule
1
src/CrawlAbstractLvl/CrawlAbstractLevelAssets
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 07295d0e4ea37e7e17b1eca717b6ab6d1f5c8c60
|
13
src/CrawlAbstractLvl/README.md
Normal file
13
src/CrawlAbstractLvl/README.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Crawl Abstract lvl
|
||||||
|
|
||||||
|
|
||||||
|
# 
|
||||||
|
|
||||||
|
This level is a tutorial in which you are offered to pass a short level during which tooltips will be shown:
|
||||||
|
* How to control a snake.
|
||||||
|
* How to interact with game objects.
|
||||||
|
|
||||||
|
There are 3 types of objects in the level:
|
||||||
|
* Repulsive (blue) will push the snake side away from itself, just like the edges of the card.
|
||||||
|
* Destructive (red) destroys the snake.
|
||||||
|
* Buff (green) whose function is that it removes all obstacles visible on the screen.
|
18
src/CrawlAbstractLvl/abstractlvl.cpp
Normal file
18
src/CrawlAbstractLvl/abstractlvl.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "abstractlvl.h"
|
||||||
|
#include "abslvlworld.h"
|
||||||
|
|
||||||
|
AbstractLvl::AbstractLvl() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CRAWL::IWorld *AbstractLvl::world() {
|
||||||
|
initAbstractLvlResources();
|
||||||
|
return new AbsLvlWorld();
|
||||||
|
}
|
28
src/CrawlAbstractLvl/abstractlvl.h
Normal file
28
src/CrawlAbstractLvl/abstractlvl.h
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef ABSTRACTLVL_H
|
||||||
|
#define ABSTRACTLVL_H
|
||||||
|
|
||||||
|
#include <Crawl/ilevel.h>
|
||||||
|
#include "abstractlvl_global.h"
|
||||||
|
|
||||||
|
inline void initAbstractLvlResources() { Q_INIT_RESOURCE(AbstractLvl);
|
||||||
|
Q_INIT_RESOURCE(absLvlRes);}
|
||||||
|
/**
|
||||||
|
* @brief The AbstractLvl class This is test lvlv wraper of the crawl
|
||||||
|
*/
|
||||||
|
class CRAWL_ABSTRACT_LEVEL_EXPORT AbstractLvl: public CRAWL::ILevel {
|
||||||
|
public:
|
||||||
|
AbstractLvl();
|
||||||
|
|
||||||
|
// ILevel interface
|
||||||
|
public:
|
||||||
|
CRAWL::IWorld *world() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ABSTRACTLVL_H
|
12
src/CrawlAbstractLvl/abstractlvl_global.h
Normal file
12
src/CrawlAbstractLvl/abstractlvl_global.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef Crawl_ABSTRACT_LEVEL_GLOBAL_H
|
||||||
|
#define Crawl_ABSTRACT_LEVEL_GLOBAL_H
|
||||||
|
|
||||||
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
#if defined(CRAWL_ABSTRACT_LEVEL_LIBRARY)
|
||||||
|
# define CRAWL_ABSTRACT_LEVEL_EXPORT Q_DECL_EXPORT
|
||||||
|
#else
|
||||||
|
# define CRAWL_ABSTRACT_LEVEL_EXPORT Q_DECL_IMPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // Crawl_ABSTRACT_LEVEL_GLOBAL_H
|
16
src/CrawlAbstractLvl/private/abslvlcontrol.cpp
Normal file
16
src/CrawlAbstractLvl/private/abslvlcontrol.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "abslvlcontrol.h"
|
||||||
|
|
||||||
|
AbsLvlControl::AbsLvlControl() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AbsLvlControl::initQmlView() const {
|
||||||
|
return "qrc:/qml/AbsLvlControl.qml";
|
||||||
|
}
|
24
src/CrawlAbstractLvl/private/abslvlcontrol.h
Normal file
24
src/CrawlAbstractLvl/private/abslvlcontrol.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef ABSLVLCONTROL_H
|
||||||
|
#define ABSLVLCONTROL_H
|
||||||
|
#include "Crawl/defaultcontrol.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The AbsLvlControl class This controll support custom camera-ratation functions.
|
||||||
|
*/
|
||||||
|
class AbsLvlControl: public CRAWL::DefaultControl
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
AbsLvlControl();
|
||||||
|
QString initQmlView() const override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ABSLVLCONTROL_H
|
23
src/CrawlAbstractLvl/private/abslvlsnake.cpp
Normal file
23
src/CrawlAbstractLvl/private/abslvlsnake.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "abslvlsnake.h"
|
||||||
|
#include "abslvlsnakeitem.h"
|
||||||
|
|
||||||
|
AbsLvlSnake::AbsLvlSnake(): Snake("Snake") {
|
||||||
|
setBreakingForce(50);
|
||||||
|
setAngularVelocity(100);
|
||||||
|
setColor("#90faaa");
|
||||||
|
setMash("qrc:/mesh/meshes/SnakePatternHead.mesh");
|
||||||
|
setSize({2,1,1});
|
||||||
|
|
||||||
|
registerBodyitem<AbsLvlSnakeItem>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbsLvlSnake::onIntersects(const IWorldItem *item) {
|
||||||
|
Q_UNUSED(item);
|
||||||
|
}
|
26
src/CrawlAbstractLvl/private/abslvlsnake.h
Normal file
26
src/CrawlAbstractLvl/private/abslvlsnake.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef ABSLVLSNAKE_H
|
||||||
|
#define ABSLVLSNAKE_H
|
||||||
|
|
||||||
|
#include "Crawl/snake.h"
|
||||||
|
|
||||||
|
class AbsLvlSnake : public CRAWL::Snake {
|
||||||
|
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
AbsLvlSnake();
|
||||||
|
|
||||||
|
// IWorldItem interface
|
||||||
|
protected:
|
||||||
|
void onIntersects(const IWorldItem *item) override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ABSLVLSNAKE_H
|
19
src/CrawlAbstractLvl/private/abslvlsnakeitem.cpp
Normal file
19
src/CrawlAbstractLvl/private/abslvlsnakeitem.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "abslvlsnakeitem.h"
|
||||||
|
|
||||||
|
AbsLvlSnakeItem::AbsLvlSnakeItem() {
|
||||||
|
setMash("qrc:/mesh/meshes/SnakePatternBody.mesh");
|
||||||
|
setColor("#20aa9a");
|
||||||
|
setSize({1,1,1});
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbsLvlSnakeItem::onIntersects(const IWorldItem *item) {
|
||||||
|
Q_UNUSED(item);
|
||||||
|
|
||||||
|
}
|
25
src/CrawlAbstractLvl/private/abslvlsnakeitem.h
Normal file
25
src/CrawlAbstractLvl/private/abslvlsnakeitem.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef ABSLVLSNAKEITEM_H
|
||||||
|
#define ABSLVLSNAKEITEM_H
|
||||||
|
|
||||||
|
#include "Crawl/snakeitem.h"
|
||||||
|
|
||||||
|
class AbsLvlSnakeItem: public CRAWL::SnakeItem {
|
||||||
|
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
AbsLvlSnakeItem();
|
||||||
|
|
||||||
|
// IWorldItem interface
|
||||||
|
protected:
|
||||||
|
void onIntersects(const IWorldItem *item) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ABSLVLSNAKEITEM_H
|
60
src/CrawlAbstractLvl/private/abslvlworld.cpp
Normal file
60
src/CrawlAbstractLvl/private/abslvlworld.cpp
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "baff.h"
|
||||||
|
#include "obstacleblue.h"
|
||||||
|
#include "obstaclered.h"
|
||||||
|
#include "abslvlcontrol.h"
|
||||||
|
#include "abslvlworld.h"
|
||||||
|
#include <abslvlsnake.h>
|
||||||
|
#include "Crawl/iworlditem.h"
|
||||||
|
|
||||||
|
|
||||||
|
AbsLvlWorld::AbsLvlWorld() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CRAWL::IPlayer *AbsLvlWorld::initPlayer() const {
|
||||||
|
return new AbsLvlSnake();
|
||||||
|
}
|
||||||
|
|
||||||
|
CRAWL::WorldRule *AbsLvlWorld::initWorldRules() {
|
||||||
|
return new CRAWL::WorldRule {
|
||||||
|
{0, {{registerObject<Baff>(), 1}}},
|
||||||
|
{10, {{registerObject<ObstacleBlue>(), 1}}},
|
||||||
|
{20, {{registerObject<ObstacleRed>(), 1}}}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AbsLvlWorld::initHdrBackGround() const {
|
||||||
|
return "qrc:/hdr/hdr/plate_absLvl.hdr";
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AbsLvlWorld::description() const {
|
||||||
|
return tr("This a abstract lvl");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AbsLvlWorld::imagePreview() const {
|
||||||
|
return "qrc:/hdr/hdr/testHDR.jpg";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AbsLvlWorld::name() const {
|
||||||
|
return tr("AbstractLvl");
|
||||||
|
}
|
||||||
|
|
||||||
|
int AbsLvlWorld::costToUnlock() const {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CRAWL::IControl *AbsLvlWorld::initUserInterface() const {
|
||||||
|
return new AbsLvlControl();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AbsLvlWorld::initPlayerControl(CRAWL::IControl *control) {
|
||||||
|
return IWorld::initPlayerControl(control);
|
||||||
|
}
|
32
src/CrawlAbstractLvl/private/abslvlworld.h
Normal file
32
src/CrawlAbstractLvl/private/abslvlworld.h
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef ABSLEVELWORLD_H
|
||||||
|
#define ABSLEVELWORLD_H
|
||||||
|
|
||||||
|
#include "Crawl/iworld.h"
|
||||||
|
|
||||||
|
class AbsLvlWorld : public CRAWL::IWorld {
|
||||||
|
|
||||||
|
// IWorld interface
|
||||||
|
public:
|
||||||
|
|
||||||
|
AbsLvlWorld();
|
||||||
|
|
||||||
|
CRAWL::IPlayer *initPlayer() const override;
|
||||||
|
CRAWL::WorldRule *initWorldRules() override;
|
||||||
|
QString initHdrBackGround() const override;
|
||||||
|
QString description() const override;
|
||||||
|
QString imagePreview() const override;
|
||||||
|
QString name() const override;
|
||||||
|
int costToUnlock() const override;
|
||||||
|
CRAWL::IControl *initUserInterface() const override;
|
||||||
|
void initPlayerControl(CRAWL::IControl *control) override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ABSLEVELWORLD_H
|
18
src/CrawlAbstractLvl/private/baff.cpp
Normal file
18
src/CrawlAbstractLvl/private/baff.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "baff.h"
|
||||||
|
|
||||||
|
Baff::Baff() : IWorldItem("Baff") {
|
||||||
|
setMash("qrc:/mesh/meshes/Baff.mesh");
|
||||||
|
setSize({1,1,1});
|
||||||
|
setZ(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Baff::onIntersects(const IWorldItem *item) {
|
||||||
|
Q_UNUSED(item);
|
||||||
|
}
|
22
src/CrawlAbstractLvl/private/baff.h
Normal file
22
src/CrawlAbstractLvl/private/baff.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef OBJBAFF_H
|
||||||
|
#define OBJBAFF_H
|
||||||
|
#include "Crawl/iworlditem.h"
|
||||||
|
|
||||||
|
|
||||||
|
class Baff: public CRAWL::IWorldItem {
|
||||||
|
public:
|
||||||
|
Baff();
|
||||||
|
|
||||||
|
// IWorldItem interface
|
||||||
|
protected:
|
||||||
|
void onIntersects(const IWorldItem *item) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // OBJBAFF_H
|
18
src/CrawlAbstractLvl/private/obstacleblue.cpp
Normal file
18
src/CrawlAbstractLvl/private/obstacleblue.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "obstacleblue.h"
|
||||||
|
|
||||||
|
ObstacleBlue::ObstacleBlue() : IWorldItem("OstacleBlue") {
|
||||||
|
setMash("qrc:/mesh/meshes/ObstacleBlue.mesh");
|
||||||
|
setSize({1,1,1});
|
||||||
|
setZ(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObstacleBlue::onIntersects(const IWorldItem *item) {
|
||||||
|
Q_UNUSED(item);
|
||||||
|
}
|
22
src/CrawlAbstractLvl/private/obstacleblue.h
Normal file
22
src/CrawlAbstractLvl/private/obstacleblue.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef OBJOBSTACLEBLUE_H
|
||||||
|
#define OBJOBSTACLEBLUE_H
|
||||||
|
#include "Crawl/iworlditem.h"
|
||||||
|
|
||||||
|
|
||||||
|
class ObstacleBlue: public CRAWL::IWorldItem {
|
||||||
|
public:
|
||||||
|
ObstacleBlue();
|
||||||
|
|
||||||
|
// IWorldItem interface
|
||||||
|
protected:
|
||||||
|
void onIntersects(const IWorldItem *item) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // OBJOBSTACLEBLUE_H
|
18
src/CrawlAbstractLvl/private/obstaclered.cpp
Normal file
18
src/CrawlAbstractLvl/private/obstaclered.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "obstaclered.h"
|
||||||
|
|
||||||
|
ObstacleRed::ObstacleRed() : IWorldItem("ObstacleRed") {
|
||||||
|
setMash("qrc:/mesh/meshes/ObstacleRed.mesh");
|
||||||
|
setSize({1,1,1});
|
||||||
|
setZ(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObstacleRed::onIntersects(const IWorldItem *item) {
|
||||||
|
Q_UNUSED(item);
|
||||||
|
}
|
22
src/CrawlAbstractLvl/private/obstaclered.h
Normal file
22
src/CrawlAbstractLvl/private/obstaclered.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the GPLv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef OBJOBSTACLERED_H
|
||||||
|
#define OBJOBSTACLERED_H
|
||||||
|
#include "Crawl/iworlditem.h"
|
||||||
|
|
||||||
|
|
||||||
|
class ObstacleRed: public CRAWL::IWorldItem {
|
||||||
|
public:
|
||||||
|
ObstacleRed();
|
||||||
|
|
||||||
|
// IWorldItem interface
|
||||||
|
protected:
|
||||||
|
void onIntersects(const IWorldItem *item) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // OBJOBSTACLERED_H
|
Loading…
x
Reference in New Issue
Block a user