4
1
mirror of https://github.com/QuasarApp/Snake.git synced 2025-05-09 07:59:48 +00:00

ref Added groupobject obstacle red.

This commit is contained in:
IgorekLoschinin 2021-09-22 22:14:43 +03:00
parent 3a2287bb19
commit d8b5059c7b
7 changed files with 120 additions and 13 deletions

@ -12,6 +12,7 @@
#include "abslvlworld.h"
#include <abslvlsnake.h>
#include "Crawl/iworlditem.h"
#include "groupobstaclered.h"
#include "Crawl/defaultlight.h"
@ -31,23 +32,23 @@ CRAWL::WorldRule *AbsLvlWorld::initWorldRules() {
return new CRAWL::WorldRule {
{0,
{
{registerObject<Baff>(), 10}, {registerObject<CRAWL::DefaultLight>(), 1}
}
},
{20,
{200,
{
{registerObject<ObstacleBlue>(), 10}, {registerObject<CRAWL::DefaultLight>(), 1}
}
},
{30,
{300,
{
{registerObject<ObstacleRed>(), 40}, {registerObject<CRAWL::DefaultLight>(), 1}
{registerObject<GroupObstacleRed>(), 1}, {registerObject<CRAWL::DefaultLight>(), 1}
}
}
},
// {30,
// {
// {registerObject<ObstacleRed>(), 40}, {registerObject<CRAWL::DefaultLight>(), 1}
// }
// }
};
}

@ -0,0 +1,33 @@
//#
//# 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 "obstaclerebitem.h"
#include "groupobstaclered.h"
namespace AbstractLvl {
GroupObstacleRed::GroupObstacleRed(): CRAWL::IWorldItem(AUTO_CLASS_NAME) {
setDistance(20);
changeLayout(CRAWL::LayoutType::LINE);
for(int i(0); i < 4; i++) {
add(new ObstacleRebItem);
}
}
void GroupObstacleRed::render(unsigned int tbfMsec) {
Layout::render(tbfMsec);
IWorldItem::render(tbfMsec);
}
void GroupObstacleRed::init() {
}
}

@ -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 GROUPOBSTACLERED_H
#define GROUPOBSTACLERED_H
#include "Crawl/layout.h"
#include "Crawl/clasteritem.h"
namespace AbstractLvl {
class GroupObstacleRed: public CRAWL::Layout, public CRAWL::IWorldItem {
public:
GroupObstacleRed();
// IRender interface
public:
void render(unsigned int tbfMsec);
void init();
};
}
#endif // GROUPOBSTACLERED_H

@ -0,0 +1,20 @@
//#
//# 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 "obstaclerebitem.h"
namespace AbstractLvl {
ObstacleRebItem::ObstacleRebItem() {
}
void ObstacleRebItem::render(unsigned int tbfMsec) {
}
}

@ -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 OBSTACLEREBITEM_H
#define OBSTACLEREBITEM_H
#include "obstaclered.h"
namespace AbstractLvl {
class ObstacleRebItem: public ObstacleRed {
public:
ObstacleRebItem();
// IRender interface
public:
void render(unsigned int tbfMsec);
};
}
#endif // OBSTACLEREBITEM_H

@ -9,7 +9,7 @@
namespace AbstractLvl {
ObstacleRed::ObstacleRed() : IWorldItem(AUTO_CLASS_NAME) {
ObstacleRed::ObstacleRed() : CRAWL::ClasterItem(AUTO_CLASS_NAME) {
setMash("qrc:/mesh/meshes/ObstacleRed.mesh");
setSize({1,1,1});
setColor("#ff1927");

@ -7,11 +7,11 @@
#ifndef OBJOBSTACLERED_H
#define OBJOBSTACLERED_H
#include "Crawl/iworlditem.h"
#include "Crawl/clasteritem.h"
namespace AbstractLvl {
class ObstacleRed: public CRAWL::IWorldItem {
class ObstacleRed: public CRAWL::ClasterItem {
public:
ObstacleRed();