mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-04-27 18:24:41 +00:00
ref #88 added hungele flora
This commit is contained in:
parent
fc0b60f15f
commit
0aa2488fb0
15
src/JungleLvl/private/blueegg.cpp
Normal file
15
src/JungleLvl/private/blueegg.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
//#
|
||||
//# 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 "blueegg.h"
|
||||
namespace JungleLvl {
|
||||
|
||||
BlueEgg::BlueEgg(): Egg(AUTO_CLASS_NAME) {
|
||||
setBaseColorMap("qrc:/mesh/meshes/Other/EggBlue_Base.jpg");
|
||||
}
|
||||
|
||||
}
|
24
src/JungleLvl/private/blueegg.h
Normal file
24
src/JungleLvl/private/blueegg.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 BLUEEGG_H
|
||||
#define BLUEEGG_H
|
||||
|
||||
#include "egg.h"
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
|
||||
class BlueEgg: public Egg
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BlueEgg();
|
||||
};
|
||||
}
|
||||
#endif // BLUEEGG_H
|
28
src/JungleLvl/private/egg.cpp
Normal file
28
src/JungleLvl/private/egg.cpp
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.
|
||||
//#
|
||||
|
||||
|
||||
#include "egg.h"
|
||||
namespace JungleLvl {
|
||||
|
||||
Egg::Egg(const QString name): CRAWL::IWorldItem(name)
|
||||
{
|
||||
QStringList mashes {
|
||||
"qrc:/mesh/meshes/Other/Egg.mesh",
|
||||
};
|
||||
|
||||
setMash(mashes[rand() % mashes.size()]);
|
||||
|
||||
setSize({1,1,1});
|
||||
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
|
||||
}
|
||||
|
||||
void Egg::onIntersects(const IWorldItem *) {
|
||||
|
||||
}
|
||||
|
||||
}
|
30
src/JungleLvl/private/egg.h
Normal file
30
src/JungleLvl/private/egg.h
Normal file
@ -0,0 +1,30 @@
|
||||
//#
|
||||
//# 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 EGG_H
|
||||
#define EGG_H
|
||||
|
||||
|
||||
#include <Crawl/iworlditem.h>
|
||||
#include <jungle_global.h>
|
||||
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
|
||||
class CRAWL_JUNGLE_LEVEL_EXPORT Egg: public CRAWL::IWorldItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Egg(const QString name);
|
||||
void onIntersects(const IWorldItem *);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif // EGG_H
|
27
src/JungleLvl/private/ivy.cpp
Normal file
27
src/JungleLvl/private/ivy.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
//#
|
||||
//# 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 "ivy.h"
|
||||
namespace JungleLvl {
|
||||
|
||||
Ivy::Ivy(): CRAWL::IWorldItem(AUTO_CLASS_NAME) {
|
||||
QStringList mashes {
|
||||
"qrc:/mesh/meshes/Plant/ivy.mesh",
|
||||
|
||||
};
|
||||
|
||||
setMash(mashes[rand() % mashes.size()]);
|
||||
|
||||
setBaseColorMap("qrc:/mesh/meshes/Plant/Ivy_Base.jpg");
|
||||
setSize({1,1,1});
|
||||
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
|
||||
}
|
||||
|
||||
void Ivy::onIntersects(const IWorldItem *) {
|
||||
|
||||
}
|
||||
}
|
27
src/JungleLvl/private/ivy.h
Normal file
27
src/JungleLvl/private/ivy.h
Normal file
@ -0,0 +1,27 @@
|
||||
//#
|
||||
//# 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 IVY_H
|
||||
#define IVY_H
|
||||
|
||||
#include <Crawl/iworlditem.h>
|
||||
#include <jungle_global.h>
|
||||
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
class CRAWL_JUNGLE_LEVEL_EXPORT Ivy: public CRAWL::IWorldItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Ivy();
|
||||
void onIntersects(const IWorldItem *);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif // IVY_H
|
29
src/JungleLvl/private/plant.cpp
Normal file
29
src/JungleLvl/private/plant.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
//#
|
||||
//# 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 "plant.h"
|
||||
namespace JungleLvl {
|
||||
|
||||
Plant::Plant(): CRAWL::IWorldItem(AUTO_CLASS_NAME) {
|
||||
QStringList mashes {
|
||||
"qrc:/mesh/meshes/Plant/Plant_1.mesh",
|
||||
"qrc:/mesh/meshes/Plant/Plant_2.mesh"
|
||||
|
||||
};
|
||||
|
||||
setMash(mashes[rand() % mashes.size()]);
|
||||
|
||||
setBaseColorMap("qrc:/mesh/meshes/Plant/Plant_Base.jpg");
|
||||
setSize({1,1,1});
|
||||
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
|
||||
}
|
||||
|
||||
void Plant::onIntersects(const IWorldItem *) {
|
||||
|
||||
}
|
||||
}
|
25
src/JungleLvl/private/plant.h
Normal file
25
src/JungleLvl/private/plant.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 PLANT_H
|
||||
#define PLANT_H
|
||||
|
||||
#include <Crawl/iworlditem.h>
|
||||
#include <jungle_global.h>
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
class CRAWL_JUNGLE_LEVEL_EXPORT Plant: public CRAWL::IWorldItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Plant();
|
||||
|
||||
void onIntersects(const IWorldItem *);
|
||||
};
|
||||
}
|
||||
#endif // PLANT_H
|
16
src/JungleLvl/private/purpleegg.cpp
Normal file
16
src/JungleLvl/private/purpleegg.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 "purpleegg.h"
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
PurpleEgg::PurpleEgg(): Egg(AUTO_CLASS_NAME) {
|
||||
setBaseColorMap("qrc:/mesh/meshes/Other/EggPurple_Base.jpg");
|
||||
}
|
||||
|
||||
}
|
21
src/JungleLvl/private/purpleegg.h
Normal file
21
src/JungleLvl/private/purpleegg.h
Normal file
@ -0,0 +1,21 @@
|
||||
//#
|
||||
//# 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 EGGPURPLE_H
|
||||
#define EGGPURPLE_H
|
||||
#include "egg.h"
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
class PurpleEgg: public Egg
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PurpleEgg();
|
||||
};
|
||||
}
|
||||
#endif // EGGPURPLE_H
|
15
src/JungleLvl/private/redegg.cpp
Normal file
15
src/JungleLvl/private/redegg.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
//#
|
||||
//# 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 "redegg.h"
|
||||
namespace JungleLvl {
|
||||
|
||||
RedEgg::RedEgg(): Egg(AUTO_CLASS_NAME) {
|
||||
setBaseColorMap("qrc:/mesh/meshes/Other/EggRed_Base.jpg");
|
||||
}
|
||||
|
||||
}
|
23
src/JungleLvl/private/redegg.h
Normal file
23
src/JungleLvl/private/redegg.h
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.
|
||||
//#
|
||||
|
||||
|
||||
#ifndef REDEGG_H
|
||||
#define REDEGG_H
|
||||
#include "egg.h"
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
class RedEgg: public Egg
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RedEgg();
|
||||
};
|
||||
|
||||
}
|
||||
#endif // REDEGG_H
|
35
src/JungleLvl/private/stone.cpp
Normal file
35
src/JungleLvl/private/stone.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
//#
|
||||
//# 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 "stone.h"
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
|
||||
Stone::Stone(): CRAWL::IWorldItem(AUTO_CLASS_NAME)
|
||||
{
|
||||
QStringList mashes {
|
||||
"qrc:/mesh/meshes/Stone/Stone_1.mesh",
|
||||
"qrc:/mesh/meshes/Stone/Stone_2.mesh",
|
||||
"qrc:/mesh/meshes/Stone/Stone_3.mesh",
|
||||
|
||||
};
|
||||
|
||||
setMash(mashes[rand() % mashes.size()]);
|
||||
|
||||
setBaseColorMap("qrc:/mesh/meshes/Stone/Stone_Base.jpg");
|
||||
setNormalMap("qrc:/mesh/meshes/Stone/Stone_Normal.jpg");
|
||||
|
||||
setSize({1,1,1});
|
||||
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
|
||||
}
|
||||
|
||||
void Stone::onIntersects(const IWorldItem *) {
|
||||
|
||||
}
|
||||
|
||||
}
|
26
src/JungleLvl/private/stone.h
Normal file
26
src/JungleLvl/private/stone.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 STONE_H
|
||||
#define STONE_H
|
||||
|
||||
#include <Crawl/iworlditem.h>
|
||||
#include <jungle_global.h>
|
||||
namespace JungleLvl {
|
||||
|
||||
|
||||
class CRAWL_JUNGLE_LEVEL_EXPORT Stone: public CRAWL::IWorldItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Stone();
|
||||
void onIntersects(const IWorldItem *);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif // STONE_H
|
37
src/JungleLvl/private/wood.cpp
Normal file
37
src/JungleLvl/private/wood.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
//#
|
||||
//# 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 "wood.h"
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
Wood::Wood(): CRAWL::IWorldItem(AUTO_CLASS_NAME) {
|
||||
QStringList mashes {
|
||||
"qrc:/mesh/meshes/Wood/Wood_1.mesh",
|
||||
"qrc:/mesh/meshes/Wood/Wood_2.mesh",
|
||||
"qrc:/mesh/meshes/Wood/Wood_3.mesh",
|
||||
"qrc:/mesh/meshes/Wood/Wood_4.mesh",
|
||||
"qrc:/mesh/meshes/Wood/Wood_5.mesh",
|
||||
"qrc:/mesh/meshes/Wood/Wood_6.mesh",
|
||||
"qrc:/mesh/meshes/Wood/Wood_7.mesh",
|
||||
"qrc:/mesh/meshes/Wood/Wood_8.mesh",
|
||||
|
||||
};
|
||||
|
||||
setMash(mashes[rand() % mashes.size()]);
|
||||
|
||||
setBaseColorMap("qrc:/mesh/meshes/Wood/Wood_Base.jpg");
|
||||
setNormalMap("qrc:/mesh/meshes/Wood/Wood_Normal.jpg");
|
||||
setRoughnessMap("qrc:/mesh/meshes/Wood/Wood_Roughness.jpg");
|
||||
setSize({1,1,1});
|
||||
setRatation(QQuaternion::fromEulerAngles({0,0, static_cast<float>(rand() % 360)}));
|
||||
}
|
||||
|
||||
void Wood::onIntersects(const IWorldItem *) {
|
||||
|
||||
}
|
||||
}
|
20
src/JungleLvl/private/wood.h
Normal file
20
src/JungleLvl/private/wood.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef WOOD_H
|
||||
#define WOOD_H
|
||||
|
||||
|
||||
#include <Crawl/iworlditem.h>
|
||||
#include <jungle_global.h>
|
||||
|
||||
namespace JungleLvl {
|
||||
|
||||
class CRAWL_JUNGLE_LEVEL_EXPORT Wood: public CRAWL::IWorldItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Wood();
|
||||
void onIntersects(const IWorldItem *);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif // WOOD_H
|
@ -12,6 +12,13 @@
|
||||
#include "tree.h"
|
||||
#include "world.h"
|
||||
#include "Crawl/iworlditem.h"
|
||||
#include "ivy.h"
|
||||
#include "plant.h"
|
||||
#include "stone.h"
|
||||
#include "wood.h"
|
||||
#include "redegg.h"
|
||||
#include "purpleegg.h"
|
||||
#include "blueegg.h"
|
||||
|
||||
#include <Crawl/snake.h>
|
||||
namespace JungleLvl {
|
||||
@ -24,18 +31,35 @@ World::World() {
|
||||
CRAWL::WorldRule *World::initWorldRules() {
|
||||
return new CRAWL::WorldRule {
|
||||
{0, {
|
||||
{registerObject<Ground>(), 1},
|
||||
{registerObject<Grees>(), 500},
|
||||
{registerObject<LongGress>(), 100},
|
||||
{registerObject<Tree>(), 0}
|
||||
{registerObject<Ground>(), 1},
|
||||
{registerObject<Grees>(), 500},
|
||||
{registerObject<LongGress>(), 100}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{500, {
|
||||
{registerObject<Ground>(), 1},
|
||||
{registerObject<Grees>(), 500},
|
||||
{registerObject<LongGress>(), 100},
|
||||
{registerObject<Tree>(), 100}
|
||||
{5000, {
|
||||
{registerObject<Ground>(), 1},
|
||||
{registerObject<Grees>(), 500},
|
||||
{registerObject<LongGress>(), 100},
|
||||
{registerObject<Plant>(), 20},
|
||||
{registerObject<Wood>(), 25},
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{10000, {
|
||||
{registerObject<Ground>(), 1},
|
||||
{registerObject<Grees>(), 500},
|
||||
{registerObject<LongGress>(), 100},
|
||||
{registerObject<Tree>(), 50},
|
||||
{registerObject<Plant>(), 20},
|
||||
{registerObject<Ivy>(), 25},
|
||||
{registerObject<Stone>(), 25},
|
||||
{registerObject<Wood>(), 25},
|
||||
{registerObject<RedEgg>(), 5},
|
||||
{registerObject<PurpleEgg>(), 5},
|
||||
{registerObject<BlueEgg>(), 5},
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user