Fix bug with missing return value for effect updating.

pull/28/head
sigonasr2 1 year ago
parent 9db2565060
commit 2f95e71114
  1. 1
      .gitignore
  2. 1
      Crawler/Effect.cpp
  3. 8
      Crawler/Effect.h
  4. 6
      Crawler/Player.cpp
  5. 2
      Crawler/Player.h
  6. 3
      Crawler/olcPixelGameEngine.h
  7. BIN
      Crawler/pge.data
  8. 1
      Crawler/pge.html
  9. 1
      Crawler/pge.js
  10. BIN
      Crawler/pge.wasm

1
.gitignore vendored

@ -10,6 +10,7 @@
*.userosscache
*.sln.docstates
emsdk
emscripten
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

@ -19,6 +19,7 @@ bool Effect::Update(float fElapsedTime){
}
}
animation.UpdateState(internal_animState,fElapsedTime);
return true;
}
void Effect::Draw(){

@ -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();

@ -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);

@ -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.
Loading…
Cancel
Save