Skip to content

Commit

Permalink
Merge pull request darkforest-eth#10 from cha0sg0d/tweaks
Browse files Browse the repository at this point in the history
cosmetic improvements :)
  • Loading branch information
cha0sg0d committed Dec 31, 2021
2 parents 66d7662 + e38129f commit f7b4333
Show file tree
Hide file tree
Showing 8 changed files with 2,345 additions and 19 deletions.
Binary file added public/round_art/dfdao_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/Backend/GameLogic/GameManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1822,8 +1822,8 @@ class GameManager extends EventEmitter {

do {
// sample from square
x = Math.random() * this.worldRadius * 2 - this.worldRadius;
y = Math.random() * this.worldRadius * 2 - this.worldRadius;
x = Math.random() * radius * 2 - radius;
y = Math.random() * radius * 2 - radius;
d = Math.sqrt(x ** 2 + y ** 2);
p = this.spaceTypePerlin({ x, y }, false);
} while (
Expand Down
2,280 changes: 2,280 additions & 0 deletions src/Backend/Network/twitters.ts

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/Frontend/Game/NotificationManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const enum NotificationType {
FoundBiomeLava,
FoundBiomeCorrupted,
PlanetLost,
PlanetDestroyed,
PlanetWon,
PlanetAttacked,
ArtifactProspected,
Expand Down Expand Up @@ -216,6 +217,9 @@ class NotificationManager extends EventEmitter {
break;
case NotificationType.PlanetAttacked:
return <PlanetAttacked height={'48px'} width={'48px'} />;
case NotificationType.PlanetDestroyed:
return <PlanetLost height={'48px'} width={'48px'} />;
break;
break;
case NotificationType.PlanetLost:
return <PlanetLost height={'48px'} width={'48px'} />;
Expand Down Expand Up @@ -503,6 +507,15 @@ class NotificationManager extends EventEmitter {
);
}

planetDestroyed(planet: Planet): void {
this.notify(
NotificationType.CanUpgrade,
<span>
You destroyed <PlanetNameLink planet={planet} />, boom! <br />
</span>
);
}

balanceEmpty(): void {
this.notify(
NotificationType.BalanceEmpty,
Expand Down
41 changes: 34 additions & 7 deletions src/Frontend/Pages/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ export default function LandingPage() {
<p>
<White>Dark Forest</White>
<br />
<Text>zkSNARK space warfare</Text>
<Text>☠️ Death of the Universe 🪐</Text>
<br />
<Text>Round 4: Society Eggnog - Lightning Round</Text>
<Link
to='https://medium.com/dfdao/a-dark-forest-new-years-community-round-death-of-the-universe-785af7c2b56e'>
Round Info
</Link>
</p>

<Spacer height={16} />
Expand Down Expand Up @@ -159,17 +162,41 @@ export default function LandingPage() {
<td>
10/01/<HideSmall>20</HideSmall>21
</td>
<td>t.b.d</td>
<td>
<Link to='https://twitter.com/orden_gg'>@orden_gg</Link>
</td>
</TRow>
<TRow>
<td>
Guild W - For Pioneers
</td>
<td>
12/03/<HideSmall>20</HideSmall>21
</td>
<td>
<Link to='https://twitter.com/marrowdao'>Red Team</Link>
</td>
</TRow>
<TRow>
<td>
dfdao + friends - ☠️🪐
</td>
<td>
1/01/<HideSmall>20</HideSmall>22
</td>
<td>
t.b.d.
</td>
</TRow>
</tbody>
</table>
</div>

<Spacer height={32} />

<EmailWrapper>
<EmailCTA mode={EmailCTAMode.SUBSCRIBE} />
</EmailWrapper>
<p>
<Text>Leaderboard inside...</Text>
</p>

<Spacer height={16} />

Expand Down Expand Up @@ -200,7 +227,7 @@ export default function LandingPage() {
</VariousLinksContainer>
</MainContentContainer>

<Spacer height={128} />
{/* <Spacer height={128} /> */}

<LeadboardDisplay />

Expand Down
12 changes: 9 additions & 3 deletions src/Frontend/Renderers/GameRenderer/UIRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ export class UIRenderer {
queueBorders() {
const { circleRenderer, gameUIManager } = this.renderer;
const tenMinutesInSeconds = 10 * 60;
const radius = shrinkAlgorithm(Date.now()/1000 + tenMinutesInSeconds, gameUIManager.getContractConstants());
const initRadius = gameUIManager.getContractConstants().INITIAL_WORLD_RADIUS;
let radius;
if(gameUIManager.getContractConstants().SHRINK > 0) {
radius = shrinkAlgorithm(Date.now()/1000 + tenMinutesInSeconds, gameUIManager.getContractConstants());
const initRadius = gameUIManager.getContractConstants().INITIAL_WORLD_RADIUS;
circleRenderer.queueCircleWorld({ x: 0, y: 0 }, initRadius, purpleA, 2);
}
else {
radius = gameUIManager.getWorldRadius();
}
whiteA[3] = 255;
circleRenderer.queueCircleWorld({ x: 0, y: 0 }, radius, whiteA, 2);
circleRenderer.queueCircleWorld({ x: 0, y: 0 }, initRadius, purpleA, 2);
}

queueMousePath() {
Expand Down
4 changes: 2 additions & 2 deletions src/Frontend/Views/LandingPageRoundArt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export function LandingPageRoundArt() {
return (
<Container>
<ImgContainer>
<LandingPageRoundArtImg src={'/public/round_art/round4.jpg'} />
<LandingPageRoundArtImg src={'/public/round_art/dfdao_round.png'} />
<Smaller>
<Text>Art by</Text> <TwitterLink twitter='JannehMoe' />{' '}
<Text>Art by</Text> <TwitterLink twitter='komosotweets' />{' '}
</Smaller>
</ImgContainer>
</Container>
Expand Down
10 changes: 5 additions & 5 deletions src/Frontend/Views/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function LeaderboardTable({ rows }: { rows: Array<[string, number | undefined]>
}

// TODO: update this each round, or pull from contract constants
const roundEndTimestamp = '2021-10-05T04:00:00.000Z';
const roundEndTimestamp = '2022-01-05T07:59:59.000Z';
const roundEndTime = new Date(roundEndTimestamp).getTime();

function CountDown() {
Expand Down Expand Up @@ -174,7 +174,7 @@ function LeaderboardBody({ leaderboard }: { leaderboard: Leaderboard }) {
<StatsTable>
<tbody>
<tr>
<td>round 4 complete</td>
<td>Round complete</td>
<td>
<CountDown />
</td>
Expand All @@ -183,15 +183,15 @@ function LeaderboardBody({ leaderboard }: { leaderboard: Leaderboard }) {
<td>players</td>
<td>{leaderboard.entries.length}</td>
</tr>
<tr>
{/* <tr>
<td>ranked players</td>
<td>{rankedPlayers.length}</td>
</tr>
</tr> */}
</tbody>
</StatsTable>
</StatsTableContainer>
<Spacer height={8} />
<LeaderboardTable rows={rows} />
{/* <LeaderboardTable rows={rows} /> */}
</div>
);
}
Expand Down

0 comments on commit f7b4333

Please sign in to comment.