Fix bug with missing return value for effect updating.
This commit is contained in:
@@ -19,6 +19,7 @@ bool Effect::Update(float fElapsedTime){
|
||||
}
|
||||
}
|
||||
animation.UpdateState(internal_animState,fElapsedTime);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Effect::Draw(){
|
||||
|
||||
+4
-4
@@ -4,10 +4,10 @@
|
||||
#include "olcUTIL_Animate2D.h"
|
||||
|
||||
struct Effect{
|
||||
vf2d pos;
|
||||
float lifetime;
|
||||
float fadeout;
|
||||
float size;
|
||||
vf2d pos={0,0};
|
||||
float lifetime=0;
|
||||
float fadeout=0;
|
||||
float size=1;
|
||||
Effect(vf2d pos,float lifetime,AnimationState animation,float size=1.0f,float fadeout=0.0f);
|
||||
bool Update(float fElapsedTime);
|
||||
Animate2D::Frame GetFrame();
|
||||
|
||||
+3
-3
@@ -14,11 +14,12 @@ INCLUDE_game
|
||||
const float Player::GROUND_SLAM_SPIN_TIME=0.6f;
|
||||
const float Player::GROUND_SLAM_COOLDOWN=20;
|
||||
|
||||
Player::Player(){
|
||||
Player::Player():
|
||||
state(State::NORMAL),lastReleasedMovementKey(DOWN),facingDirection(DOWN){
|
||||
}
|
||||
|
||||
Player::Player(vf2d pos):
|
||||
pos(pos){
|
||||
pos(pos),state(State::NORMAL),lastReleasedMovementKey(DOWN),facingDirection(DOWN){
|
||||
}
|
||||
|
||||
void Player::SetX(float x){
|
||||
@@ -127,7 +128,6 @@ void Player::Update(float fElapsedTime){
|
||||
default:{
|
||||
//Update animations normally.
|
||||
}
|
||||
[[fallthrough]];
|
||||
}
|
||||
animation.UpdateState(internal_animState,fElapsedTime);
|
||||
groundSlamCooldown=std::max(0.f,groundSlamCooldown-fElapsedTime);
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ private:
|
||||
float spin_angle=0;
|
||||
float lastAnimationFlip=0;
|
||||
float groundSlamCooldown=0;
|
||||
State state;
|
||||
State state=State::NORMAL;
|
||||
Animate2D::Animation<AnimationState>animation;
|
||||
Animate2D::AnimationState internal_animState;
|
||||
Key lastReleasedMovementKey;
|
||||
|
||||
@@ -123,7 +123,8 @@ This means you can run your application in teh browser, great for distributing
|
||||
and submission in to jams and things! It's a bit new at the moment.
|
||||
|
||||
em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 ./YourSource.cpp -o pge.html
|
||||
|
||||
em++ -std=c++17 -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 $(Get-ChildItem *.cpp) -o
|
||||
pge.html --preload-file assets
|
||||
|
||||
|
||||
Using stb_image.h
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user