the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 66 lines 1.3 kB view raw
1#include "stdafx.h" 2#include "HeartParticle.h" 3 4// 4J - added 5void HeartParticle::init(Level *level, double x, double y, double z, double xa, double ya, double za, float scale) 6{ 7 xd *= 0.01f; 8 yd *= 0.01f; 9 zd *= 0.01f; 10 yd += 0.1; 11 12 size *= 0.75f; 13 size *= scale; 14 oSize = size; 15 16 lifetime = 16; 17 noPhysics = false; 18 19 20 setMiscTex(16 * 5); 21} 22 23HeartParticle::HeartParticle(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level, x, y, z, 0, 0, 0) 24{ 25 init(level, x, y, z, xa, ya, za, 2); 26} 27 28HeartParticle::HeartParticle(Level *level, double x, double y, double z, double xa, double ya, double za, float scale) : Particle(level, x, y, z, 0, 0, 0) 29{ 30 init(level,x,y,z,xa,ya,za,scale); 31} 32 33void HeartParticle::render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2) 34{ 35 float l = ((age + a) / lifetime) * 32; 36 if (l < 0) l = 0; 37 if (l > 1) l = 1; 38 39 size = oSize * l; 40 Particle::render(t, a, xa, ya, za, xa2, za2); 41} 42 43void HeartParticle::tick() 44{ 45 xo = x; 46 yo = y; 47 zo = z; 48 49 if (age++ >= lifetime) remove(); 50 51 move(xd, yd, zd); 52 if (y == yo) 53 { 54 xd *= 1.1; 55 zd *= 1.1; 56 } 57 xd *= 0.86f; 58 yd *= 0.86f; 59 zd *= 0.86f; 60 61 if (onGround) 62 { 63 xd *= 0.7f; 64 zd *= 0.7f; 65 } 66}