-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
116 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
# PlatScifi | ||
|
||
A platformer game by the tivect team | ||
|
||
## Building: | ||
|
||
CMake is required, and SFML will automatically be downloaded. | ||
|
||
Check out `README_BuildTemplate.md` for more specific instructions | ||
|
||
## Controls: | ||
|
||
- `[a]`/`[d]` - move left/right | ||
|
||
- `[w]`/`[space]` - jump | ||
|
||
- `[s]` - fall faster | ||
|
||
- `[r]` - reset to the spawn point | ||
|
||
- `[p]` - spawn a bouncing ball or other object (for testing) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include "../worldobject.h" | ||
|
||
// Stores a stationary image at a point in space | ||
class Spike : public WorldObject { | ||
private: | ||
// Frame oscillations | ||
long frameCount = 0; | ||
|
||
public: | ||
// Constructor: provide the name of the asset from assets (ex. "assets/tiv_logo.png") | ||
Spike(double spawnx, double spawny) : WorldObject() { | ||
locx = spawnx; | ||
locy = spawny; | ||
this->width = 1; | ||
this->height = 1; | ||
objectAttributes.insert(ObjectAttribute::Collision); | ||
objectAttributes.insert(ObjectAttribute::Deadly); | ||
} | ||
|
||
// Override update: do nothing | ||
UpdateResult update(WorldState& worldState, std::vector<WorldObject*>& objects) { | ||
return UpdateResult::None; | ||
} | ||
|
||
// Override rendering | ||
RenderData getRenderData() { | ||
frameCount++; | ||
return { | ||
RenderType::Image, | ||
coordType, | ||
locx, | ||
locy - sin(frameCount / 400) * 0.3, | ||
width, | ||
height + sin(frameCount / 400) * 0.3, | ||
{ 255, 0, 0 }, | ||
"assets/spike.png" | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters