Fix bug with missing return value for effect updating.
This commit is contained in:
parent
9db2565060
commit
2f95e71114
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,6 +10,7 @@
|
|||||||
*.userosscache
|
*.userosscache
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
emsdk
|
emsdk
|
||||||
|
emscripten
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
*.userprefs
|
*.userprefs
|
||||||
|
|||||||
@ -19,6 +19,7 @@ bool Effect::Update(float fElapsedTime){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
animation.UpdateState(internal_animState,fElapsedTime);
|
animation.UpdateState(internal_animState,fElapsedTime);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Effect::Draw(){
|
void Effect::Draw(){
|
||||||
|
|||||||
@ -4,10 +4,10 @@
|
|||||||
#include "olcUTIL_Animate2D.h"
|
#include "olcUTIL_Animate2D.h"
|
||||||
|
|
||||||
struct Effect{
|
struct Effect{
|
||||||
vf2d pos;
|
vf2d pos={0,0};
|
||||||
float lifetime;
|
float lifetime=0;
|
||||||
float fadeout;
|
float fadeout=0;
|
||||||
float size;
|
float size=1;
|
||||||
Effect(vf2d pos,float lifetime,AnimationState animation,float size=1.0f,float fadeout=0.0f);
|
Effect(vf2d pos,float lifetime,AnimationState animation,float size=1.0f,float fadeout=0.0f);
|
||||||
bool Update(float fElapsedTime);
|
bool Update(float fElapsedTime);
|
||||||
Animate2D::Frame GetFrame();
|
Animate2D::Frame GetFrame();
|
||||||
|
|||||||
@ -14,11 +14,12 @@ INCLUDE_game
|
|||||||
const float Player::GROUND_SLAM_SPIN_TIME=0.6f;
|
const float Player::GROUND_SLAM_SPIN_TIME=0.6f;
|
||||||
const float Player::GROUND_SLAM_COOLDOWN=20;
|
const float Player::GROUND_SLAM_COOLDOWN=20;
|
||||||
|
|
||||||
Player::Player(){
|
Player::Player():
|
||||||
|
state(State::NORMAL),lastReleasedMovementKey(DOWN),facingDirection(DOWN){
|
||||||
}
|
}
|
||||||
|
|
||||||
Player::Player(vf2d pos):
|
Player::Player(vf2d pos):
|
||||||
pos(pos){
|
pos(pos),state(State::NORMAL),lastReleasedMovementKey(DOWN),facingDirection(DOWN){
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetX(float x){
|
void Player::SetX(float x){
|
||||||
@ -127,7 +128,6 @@ void Player::Update(float fElapsedTime){
|
|||||||
default:{
|
default:{
|
||||||
//Update animations normally.
|
//Update animations normally.
|
||||||
}
|
}
|
||||||
[[fallthrough]];
|
|
||||||
}
|
}
|
||||||
animation.UpdateState(internal_animState,fElapsedTime);
|
animation.UpdateState(internal_animState,fElapsedTime);
|
||||||
groundSlamCooldown=std::max(0.f,groundSlamCooldown-fElapsedTime);
|
groundSlamCooldown=std::max(0.f,groundSlamCooldown-fElapsedTime);
|
||||||
|
|||||||
@ -22,7 +22,7 @@ private:
|
|||||||
float spin_angle=0;
|
float spin_angle=0;
|
||||||
float lastAnimationFlip=0;
|
float lastAnimationFlip=0;
|
||||||
float groundSlamCooldown=0;
|
float groundSlamCooldown=0;
|
||||||
State state;
|
State state=State::NORMAL;
|
||||||
Animate2D::Animation<AnimationState>animation;
|
Animate2D::Animation<AnimationState>animation;
|
||||||
Animate2D::AnimationState internal_animState;
|
Animate2D::AnimationState internal_animState;
|
||||||
Key lastReleasedMovementKey;
|
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.
|
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 ./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
|
Using stb_image.h
|
||||||
|
|||||||
BIN
Crawler/pge.data
Normal file
BIN
Crawler/pge.data
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
1
Crawler/pge.html
Normal file
1
Crawler/pge.html
Normal file
File diff suppressed because one or more lines are too long
1
Crawler/pge.js
Normal file
1
Crawler/pge.js
Normal file
File diff suppressed because one or more lines are too long
BIN
Crawler/pge.wasm
Normal file
BIN
Crawler/pge.wasm
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user