Include basic terrain map to start off.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent e283891278
commit 4f33d16db2
  1. BIN
      C++ProjectTemplate
  2. BIN
      assets/terrainmap.png
  3. 71
      ideas
  4. 57
      main.cpp
  5. 9
      pixelGameEngine.h
  6. 1963
      soundwaveEngine.h
  7. 154
      splash.h

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

71
ideas

@ -0,0 +1,71 @@
8 Sep 2022 - 8 Jan 2023
4 Months of Development Time
120 Days of Development Time
15+ Hours of Gameplay
4 Different Games (4 Seasons)
January of 2024 The Last Game of the Series will be completed.
1st Game:
-Full featured Turn-based RPG Engine
Takeaways from Seasons of Loneliness:
+ Cutscene / Game State Management
+ On-the-fly cutscene control flags, temporary cutscene object creation, timers
+ Object Management
+ Message Display Systems
+ Turn-based Combat Control Systems
+ One-button input style
+ Music & Sound
+ Personalized Touch
+ Growth System
+ Strategic Elements
+ No "Needless" Encounters
- Map System
- Event/Timeline System
- Player Drawing being tied to the camera
Season I: Winters of Loneliness
===============================
We will name important characters at the beginning of the game.
Game starts in Eagleland. Ness and Paula are out late at night and left Anna at home.
When they don't show up and it's past 1AM, Anna attempts to communicate to them using psikokinetic powers.
When the call does not yield any response, Anna heads out to investigate...
After exploring for awhile, she stumbles upon a strange weather field. Upon curiously touching it it drains all her PP and she is left unable to use abilities and helpless.
An encounter begins against a Starman Deluxe, and a surprise visit from Buzz Buzz Mk II helps Anna out. Until Buzz Buzz Mk II eventually gets swatted by Starman Deluxe leaving her at the brink of getting kidnapped. However, something happens...
Miraculously, a space satellite (?) falls out of the sky, crashes at the site of the battle and
a character pops out to join Anna and protect her using weather powers.
These new powers are alien to the world, and while defenses have been developed for psykokinetic powers, there are no such defenses against weather itself. The character is able to leverage this to their advantage to win the fight.
Afterwards, Anna thanks PLAYER and heads on her merry way, but the PLAYER stops her, asking her what she is doing and what if she gets in trouble again...
Essentially as a bodyguard, the PLAYER decides to stick around and help Anna find both Ness and Paula. And so their journey begins...
(You will have to help Buzz Buzz Mk II to learn about their "destiny".)
Weather power uses are no longer bound by finding nodes, but by using magic points (which regenerates over time).
Discovering new nodes now unlocks that power, and potentially certain nodes will unlock powers for other characters.
"Climate System"
Wet - Determines how wet the area is. While wet, seeds can grow and healing is enhanced.
Dry - During dry climates, healing is reduced.
Heat - Increases the power of fire/hot weather powers while causing trees to burn, causing raging fires and explosion damage.
Cold - Causes enemies to be slowed, prioritizing PC characters to go first. Prevents seed growth.
"Town Climate"
Does not get affected as quickly by weather affects during battles, but field effects will dramatically affect them as it will be concentrated. Changing the weather in areas may trigger new paths or close off certain ones.

@ -1,5 +1,9 @@
#define OLC_PGE_APPLICATION #define OLC_PGE_APPLICATION
#include "pixelGameEngine.h" #include "pixelGameEngine.h"
#define OLC_PGEX_SPLASHSCREEN
#include "splash.h"
#define OLC_SOUNDWAVE
#include "soundwaveEngine.h"
using namespace std; using namespace std;
@ -8,66 +12,45 @@ class Example : public olc::PixelGameEngine
public: public:
Example() Example()
{ {
sAppName = "Example"; sAppName = "Season I: Winters of Loneliness";
} }
public: public:
vector<int> data; int frameCount=0;
int TILE_WIDTH=16; float elapsedTime=0;
int TILE_HEIGHT=16; const float TARGET_RATE = 1/60.0;
int tileOffsetX=0;
int tileOffsetY=0;
int TV_WIDTH=TILE_WIDTH*8;
int TV_HEIGHT=TILE_HEIGHT*7;
int MAP_WIDTH=256;
int MAP_HEIGHT=240;
int TV_POSX=256/4;
int TV_POSY=240/4;
bool OnUserCreate() override bool OnUserCreate() override
{ {
SetPixelMode(olc::Pixel::ALPHA); SetPixelMode(olc::Pixel::ALPHA);
ConsoleCaptureStdOut(true); ConsoleCaptureStdOut(true);
// Called once at the start, so create things here // Called once at the start, so create things here
for (int i=0;i<256*240;i++) {
data.push_back(rand()%255);
}
return true; return true;
} }
bool OnUserUpdate(float fElapsedTime) override bool OnUserUpdate(float fElapsedTime) override
{ {
while (elapsedTime>TARGET_RATE) {
if (GetKey(olc::RIGHT).bPressed) { elapsedTime-=TARGET_RATE;
tileOffsetX=std::clamp(tileOffsetX+1,0,MAP_WIDTH); updateGame();
}
if (GetKey(olc::LEFT).bPressed) {
tileOffsetX=std::clamp(tileOffsetX-1,0,MAP_WIDTH);
}
if (GetKey(olc::UP).bPressed) {
tileOffsetY=std::clamp(tileOffsetY-1,0,MAP_HEIGHT);
}
if (GetKey(olc::DOWN).bPressed) {
tileOffsetY=std::clamp(tileOffsetY+1,0,MAP_HEIGHT);
}
for (int x=0;x<TV_WIDTH/TILE_WIDTH;x++) {
for (int y=0;y<TV_HEIGHT/TILE_HEIGHT;y++) {
int tileID=data[(tileOffsetY+y)*MAP_WIDTH+tileOffsetX+x];
FillRect({x*TILE_WIDTH+TV_POSX,y*TILE_HEIGHT+TV_POSY},{TILE_WIDTH,TILE_HEIGHT},olc::Pixel(tileID,tileID,tileID,255));
DrawStringDecal({x*TILE_WIDTH+TV_POSX,y*TILE_HEIGHT+TV_POSY},to_string(tileID),(tileID<128)?olc::WHITE:olc::BLACK,{0.5,0.5});
}
} }
drawGame();
return true; return true;
} }
void updateGame(){
};
void drawGame(){
};
}; };
int main() int main()
{ {
Example demo; Example demo;
if (demo.Construct(256, 240, 4, 4)) if (demo.Construct(256, 224, 4, 4))
demo.Start(); demo.Start();
return 0; return 0;

@ -928,6 +928,8 @@ namespace olc
virtual bool OnUserUpdate(float fElapsedTime); virtual bool OnUserUpdate(float fElapsedTime);
// Called once on application termination, so you can be one clean coder // Called once on application termination, so you can be one clean coder
virtual bool OnUserDestroy(); virtual bool OnUserDestroy();
virtual void GetAnyKey();
virtual void GetAnyKeyPress();
// Called when a text entry is confirmed with "enter" key // Called when a text entry is confirmed with "enter" key
virtual void OnTextEntryComplete(const std::string& sText); virtual void OnTextEntryComplete(const std::string& sText);
@ -3290,6 +3292,9 @@ namespace olc
bool PixelGameEngine::OnUserDestroy() bool PixelGameEngine::OnUserDestroy()
{ return true; } { return true; }
void PixelGameEngine::GetAnyKey(){};
void PixelGameEngine::GetAnyKeyPress(){};
void PixelGameEngine::OnTextEntryComplete(const std::string& sText) { UNUSED(sText); } void PixelGameEngine::OnTextEntryComplete(const std::string& sText) { UNUSED(sText); }
bool PixelGameEngine::OnConsoleCommand(const std::string& sCommand) { UNUSED(sCommand); return false; } bool PixelGameEngine::OnConsoleCommand(const std::string& sCommand) { UNUSED(sCommand); return false; }
@ -3437,6 +3442,7 @@ namespace olc
// Compare hardware input states from previous frame // Compare hardware input states from previous frame
auto ScanHardware = [&](HWButton* pKeys, bool* pStateOld, bool* pStateNew, uint32_t nKeyCount) auto ScanHardware = [&](HWButton* pKeys, bool* pStateOld, bool* pStateNew, uint32_t nKeyCount)
{ {
bool pressed=false;
for (uint32_t i = 0; i < nKeyCount; i++) for (uint32_t i = 0; i < nKeyCount; i++)
{ {
pKeys[i].bPressed = false; pKeys[i].bPressed = false;
@ -3445,6 +3451,7 @@ namespace olc
{ {
if (pStateNew[i]) if (pStateNew[i])
{ {
pressed=true;
pKeys[i].bPressed = !pKeys[i].bHeld; pKeys[i].bPressed = !pKeys[i].bHeld;
pKeys[i].bHeld = true; pKeys[i].bHeld = true;
} }
@ -3453,9 +3460,11 @@ namespace olc
pKeys[i].bReleased = true; pKeys[i].bReleased = true;
pKeys[i].bHeld = false; pKeys[i].bHeld = false;
} }
GetAnyKey();
} }
pStateOld[i] = pStateNew[i]; pStateOld[i] = pStateNew[i];
} }
if (pressed) {GetAnyKeyPress();}
}; };
ScanHardware(pKeyboardState, pKeyOldState, pKeyNewState, 256); ScanHardware(pKeyboardState, pKeyOldState, pKeyNewState, 256);

File diff suppressed because it is too large Load Diff

@ -0,0 +1,154 @@
#pragma once
#include "pixelGameEngine.h"
namespace olc
{
class SplashScreen : public olc::PGEX
{
public:
SplashScreen();
protected:
virtual void OnAfterUserCreate() override;
virtual bool OnBeforeUserUpdate(float& fElapsedTime) override;
private:
olc::Renderable spr;
std::vector<std::pair<olc::vf2d, olc::vf2d>> vBoom;
olc::vf2d vScale;
olc::vf2d vPosition;
float fParticleTime = 0.0f;
float fAspect = 0.0f;
bool bComplete = false;
};
}
#ifdef OLC_PGEX_SPLASHSCREEN
#undef OLC_PGEX_SPLASHSCREEN
namespace olc
{
SplashScreen::SplashScreen() : olc::PGEX(true)
{
}
void SplashScreen::OnAfterUserCreate()
{
const char logo[] =
"000000000000000000000000000000000000000000000000000000000000000000005"
"EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED1EE"
"EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED5EEE"
"EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE@E@000"
"0000000000000000000000000000000000000000000000000000000000001E1D:ZZZZ"
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1D5BZZZZZZ"
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ5@E:P0002Z0"
"02ZZX000000000000ZP0000000000000000000000000000ZX000Z002XE1DX?o`o:Poo"
"800SooaE5@E1ED5BX?ol5E@E0E1ED?oo5@E1ED5DE1D5E@ZQEEBPEE2QD5BSooclZ?olQ"
"AB?oo5DEEDEEDE:SooaEEAE5DEEDoolEADEEDEAE5AEEBZ5EE:5EE:5@E:?oo?bXoob55"
"8o3lEAEEAD5ADZ?oo5@E5EEAD5Cl01E5AD5AE5DE5@E:X01DXEEDXE1DXo3lo:Sl0800S"
"ooaE1ED5EE5BXo00EEDEEE5EE?oo5EE5EE5DEEDEEDZQEEBQD5BQD5BSl?cl0?`0ZZZ?o"
"o5D5E@EEDE03loaEEAEEDEEDoolEED5EDEAEEAEEBZ5EE:5@E:5@E:?oo?oloob008o00"
"EAEEAD01EE?co5EE5EEAD03l01DE@05AE5AE5@0:XE000EEDXE1DXooloocoo8DDSlZQE"
"5EE5EE5EDoolE1DE4E5EE?oo5AE5EE5DE5DEEDZQEEAAEEBQD5BPoo3oo3olQAB?bZ5DE"
"1D5EDEE@ooaD5AD1D5EDoolE1DEE@EAD5@EEBZ5EE51ED:5@E:P000000020080:X0000"
"00000000000000000000000000000000000:X0000002XE1DZZZZZZZZZZZZZZZZZZZZZ"
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZQD5@ZZZZZZZZZZZZZZZZZZZZZZ"
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZX5@E@00000000000000000000000"
"00000000000000000000000000000000000000001E1EEEEEEEEEEEEEEEEEEEEEEEEEE"
"EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED5EEEEEEEEEEEEEEEEEEEEEEEEEEE"
"EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE@5EEEEEEEEEEEEEEEEEEEEEEEEEEEE"
"EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED0000000000000000000000000000000"
"0000000000000000000000000000000000000";
spr.Create(203, 24);
int px = 0, py = 0;
for (size_t b = 0; b < 1624; b += 4)
{
uint32_t sym1 = (uint32_t)logo[b + 0] - 48;
uint32_t sym2 = (uint32_t)logo[b + 1] - 48;
uint32_t sym3 = (uint32_t)logo[b + 2] - 48;
uint32_t sym4 = (uint32_t)logo[b + 3] - 48;
uint32_t r = sym1 << 18 | sym2 << 12 | sym3 << 6 | sym4;
for (int i = 0; i < 12; i++)
{
olc::Pixel p = olc::RED;
switch ((r & 0xC00000) >> 22)
{
case 0: p = olc::Pixel(0, 0, 0, 255); break;
case 1: p = olc::Pixel(255, 255, 255, 255); break;
case 2: p = olc::Pixel(255, 120, 26, 255); break;
case 3: p = olc::Pixel(79, 193, 255, 255); break;
}
spr.Sprite()->SetPixel(px, py, p);
if (++px == 203) { py++; px = 0; }
r <<= 2;
}
}
spr.Decal()->Update();
vBoom.resize(spr.Sprite()->width * spr.Sprite()->height);
vScale = { float(pge->ScreenWidth()) / 500.0f, float(pge->ScreenWidth()) / 500.0f };
fAspect = float(pge->ScreenWidth()) / float(pge->ScreenHeight());
vPosition = olc::vf2d(
(250 - spr.Sprite()->width) / 2.0f,
(250 - spr.Sprite()->height) / 2.0f / fAspect);
for (int y = 0; y < spr.Sprite()->height; y++)
for (int x = 0; x < spr.Sprite()->width; x++)
vBoom[y * spr.Sprite()->width + x] = std::make_pair(
vPosition + olc::vf2d(x, y),
olc::vf2d(
(float(rand()) / float(RAND_MAX)) * 10.0f - 5.0f,
(float(rand()) / float(RAND_MAX)) * 10.0f - 5.0f)
);
}
bool SplashScreen::OnBeforeUserUpdate(float& fElapsedTime)
{
if (bComplete) return false;
fParticleTime += fElapsedTime;
for (int y = 0; y < spr.Sprite()->height; y++)
for (int x = 0; x < spr.Sprite()->width; x++)
{
if (fParticleTime < 1.0f)
{
}
else if (fParticleTime < 2.0f)
{
vBoom[y * spr.Sprite()->width + x].first =
olc::vf2d(
(250 - spr.Sprite()->width) / 2.0f + float(x),
(250 - spr.Sprite()->height) / 2.0f / fAspect + float(y)
) +
olc::vf2d(
(float(rand()) / float(RAND_MAX)) * 0.5f - 0.25f,
(float(rand()) / float(RAND_MAX)) * 0.5f - 0.25f);
}
else if(fParticleTime < 5.0f)
{
vBoom[y * spr.Sprite()->width + x].first += vBoom[y * spr.Sprite()->width + x].second * fElapsedTime * 20.0f;
}
else
{
bComplete = true;
}
pge->DrawPartialDecal(vScale * vBoom[y * spr.Sprite()->width + x].first * 2.0f, spr.Decal(), olc::vf2d(x, y), { 1, 1 }, vScale * 2.0f, olc::PixelF(1.0f, 1.0f, 1.0f, std::min(1.0f, std::max(4.0f - fParticleTime, 0.0f))));
}
olc::vi2d vSize = pge->GetTextSizeProp("Copyright OneLoneCoder.com 2022");
pge->DrawStringPropDecal(olc::vf2d(float(pge->ScreenWidth()/2) - vSize.x/2, float(pge->ScreenHeight()) - vSize.y * 3.0f), "Copyright OneLoneCoder.com 2022", olc::PixelF(1.0f, 1.0f, 1.0f, 0.5f), olc::vf2d(1.0, 2.0f));
return true;
}
}
#endif
Loading…
Cancel
Save