Fangames > Game Design
Fangame Resource Library (Sprites, Tiles, Objects, etc)
WetWookie:
* (click to show/hide)
* (click to show/hide)
* (click to show/hide)
* (click to show/hide)
* (click to show/hide)
* (click to show/hide) This sprite is the hitbox. The flame particles will not kill. Origin should be center.
(click to show/hide)
* (click to show/hide)https://pastebin.com/QGVqK9fM
* (click to show/hide)draw_self();
part_emitter_region(partFire_sys,partFire_emit,x - 16, x+ 16,y-16,y+16,ps_shape_ellipse,ps_distr_linear);
part_emitter_burst(partFire_sys,partFire_emit,partFire,5);
part_emitter_burst(partFire_sys,partFire_emit,partCinder,-10);
* (click to show/hide)instance_destroy();
* (click to show/hide)part_type_destroy(partFire);
part_type_destroy(partCinder);
part_emitter_destroy(partFire_sys,partFire_emit);
part_system_destroy(partFire_sys);
* (click to show/hide)
Image origin should be center.
(click to show/hide)imgSpeed = 1;
(click to show/hide)image_angle += imgSpeed;
if imgSpeed < 117 {imgSpeed += 0.25;}
draw_sprite_ext(sprite_index, 0, x, y, 1, 1, image_angle, c_white, 1 );
* (click to show/hide)
* (click to show/hide)
* (click to show/hide) origin should be at 18x30
(click to show/hide)
* (click to show/hide)lit = 1;
// Particles
partFire_sys = part_system_create();
part_system_depth(partFire_sys,100);
// Fire Particle
partFire = part_type_create();
part_type_sprite(partFire,sprFire,0,0,1);
part_type_size(partFire,0.8,1.2,0,0);
part_type_colour2(partFire,c_orange,c_red);
part_type_alpha3(partFire,1,0.8,0);
part_type_speed(partFire,1,3,0,0);
part_type_direction(partFire,85,95,0,6);
part_type_orientation(partFire,0,359,0,0,0);
part_type_blend(partFire,1);
part_type_life(partFire,5,15);
// Cinder
partCinder = part_type_create();
part_type_shape(partCinder, pt_shape_flare);
part_type_size(partCinder,0.2,0.5,0,0);
part_type_color2(partCinder,c_orange,c_red);
part_type_alpha3(partCinder,1,0.8,0);
part_type_speed(partCinder,0.5,0.8,0,0);
part_type_direction(partCinder,85,95,0,0);
part_type_blend(partCinder,1);
part_type_life(partCinder,50,75);
// Particle Emitter
partFire_emit = part_emitter_create(partFire_sys);
part_emitter_region(partFire_sys,partFire_emit,x - 5, x+ 5,y-8,y+2,ps_shape_ellipse,ps_distr_linear);
* (click to show/hide)if lit == 1
{
part_emitter_burst(partFire_sys,partFire_emit,partFire,2);
part_emitter_burst(partFire_sys,partFire_emit,partCinder,-10);
}
* (click to show/hide)with other
{
instance_destroy();
}
lit = 1 - lit;
* (click to show/hide)part_system_clear(partFire_sys);
part_type_destroy(partFire);
part_type_destroy(partCinder);
part_emitter_destroy(partFire_sys,partFire_emit);
part_system_destroy(partFire_sys);
* (click to show/hide)
* (click to show/hide)partRain_sys = part_system_create();
partRain = part_type_create();
part_type_shape(partRain,pt_shape_line);
part_type_size(partRain, 0.2, 0.3,0,0);
part_type_color2(partRain, c_teal, c_white);
part_type_alpha2(partRain,0.5,0.1);
part_type_gravity(partRain,0.1,290);
part_type_speed(partRain,0.5,0.5,0,0);
part_type_direction(partRain,250,330,0,1);
part_type_orientation(partRain,290,290,0,0,0,);
part_type_life(partRain,115,120);
partPuddle = part_type_create();
part_type_shape(partPuddle, pt_shape_circle);
part_type_size(partPuddle,0.5,0.8,0.01,0);
part_type_scale(partPuddle,0.5,0.1);
part_type_color1(partPuddle,c_silver);
part_type_alpha2(partPuddle,0.4,0);
part_type_speed(partPuddle,0,0,0,0);
part_type_gravity(partPuddle,0,270);
part_type_life(partPuddle,50,60);
part_type_death(partRain,1,partPuddle);
partRain_emit = part_emitter_create(partRain_sys);
part_emitter_region(partRain_sys,partRain_emit,-400,room_width, -100,- 100,ps_shape_line,ps_distr_linear);
part_emitter_stream(partRain_sys,partRain_emit,partRain,5);
repeat(room_speed * 3)
{
part_system_update(partRain_sys);
}
* (click to show/hide)part_system_clear(partRain_sys);
part_type_destroy(partRain);
part_type_destroy(partPuddle);
part_emitter_destroy(partRain_sys,partRain_emit);
part_system_destroy(partRain_sys);
* (click to show/hide)
* (click to show/hide)partSnow_sys = part_system_create();
part_system_depth(partSnow_sys,50);
partSnow = part_type_create();
part_type_shape(partSnow,pt_shape_snow);
part_type_size(partSnow, 0.05, 0.2,0,0);
part_type_color1(partSnow, c_white);
part_type_alpha2(partSnow,0.5,0.05);
part_type_speed(partSnow,0.5,0.8,0.005,0);
part_type_direction(partSnow,260,280,0,2);
part_type_orientation(partSnow,0,359,0,0,0,);
part_type_life(partSnow,500,600);
partSnow_emit = part_emitter_create(partSnow_sys);
part_emitter_region(partSnow_sys,partSnow_emit,-400,room_width, -100,-100,ps_shape_line,ps_distr_linear);
part_emitter_stream(partSnow_sys,partSnow_emit,partSnow,-2);
repeat(room_speed * 20)
{
part_system_update(partSnow_sys);
}
* (click to show/hide)part_system_clear(partSnow_sys);
part_type_destroy(partSnow);
part_emitter_destroy(partSnow_sys,partSnow_emit);
part_system_destroy(partSnow_sys);
* (click to show/hide)
* (click to show/hide)https://pastebin.com/0MtjuB3N
* (click to show/hide)part_system_clear(partCloud_sys);
part_type_destroy(partCloud);
part_type_destroy(partCloud2);
part_emitter_destroy(partCloud_sys,partCloud_emit);
part_emitter_destroy(partCloud_sys,partCloud_emit2);
part_system_destroy(partCloud_sys);
* (click to show/hide)
* sprBug
* (click to show/hide)https://pastebin.com/zUJJxz4J
WetWookie:
* (click to show/hide)
* (click to show/hide)
* (click to show/hide)
* (click to show/hide)
#ifdef GL_ES
precision mediump float;
#endif
varying vec2 v_vTexcoord;
uniform float time;
uniform vec2 resolution;
#define MAX_ITER 3
void main( void )
{
vec2 v_texCoord = v_vTexcoord.xy / resolution;
vec2 p = v_vTexcoord * 3.0 - vec2(20.0);
vec2 i = p;
float c = 1.0;
float inten = .05;
for (int n = 0; n < MAX_ITER; n++)
{
float t = time * (1.0 - (3.0 / float(n+1)));
i = p + vec2(cos(t - i.x) + sin(t + i.y),
sin(t - i.y) + cos(t + i.x));
c += 1.0/length(vec2(p.x / (sin(i.x+t)/inten),
p.y / (cos(i.y+t)/inten)));
}
c /= float(MAX_ITER);
c = 1.5 - sqrt(c);
vec4 texColor = vec4(0.02 - cos(time) * 0.02, 0.05 + sin(time) * 0.02, 0.08 + cos(time) * 0.015, 1.);
texColor.rgb *= (1.0 / (1.0 - (c + 0.05)));
gl_FragColor = texColor;
}
* Give the object that draws the shader a 800x608 sprite solid white.
(click to show/hide)Information about object: objShaderBackground
Sprite: sprBrickBack
Solid: false
Visible: true
Depth: 99999
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
x = 0;
y = 0
uni_time = shader_get_uniform(shdRipple, "time");
uni_resolution = shader_get_uniform(shdRipple, "resolution");
t = current_second * current_minute;
Step Event:
execute code:
t += 0.002;
Draw Event:
execute code:
shader_set(shdRipple);
shader_set_uniform_f(uni_time,t);
shader_set_uniform_f(uni_resolution, room_width,room_height);
draw_self();
shader_reset();
* (click to show/hide)
* (click to show/hide)
* (click to show/hide)//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
uniform float time;
uniform vec2 resolution;
float hashX( float n ){
return fract(sin(n)*758.5453);
}
float noise2X( in vec2 x ){
vec2 p = floor(x);
vec2 f = fract(x);
float n = p.x + p.y*57.0;
float res =
mix (
mix (
hashX (
n + 0.0
), hashX (
n + 1.0
), f.x
), mix (
hashX (
n + 57.0
), hashX (
n + 58.0
), f.x
), f.y
);
return res;
}
#define snoisesinpow(a,b) pow(1.0 - (abs(noise2X(a) - 0.5) * 2.0), b)
float heightwater(vec2 pos){
//pos *= 0.009;
float res = 0.0;
float w = 0.0;
float wz = 1.0;
float chop = 6.0;
float tmod = 260.1;
for(int i=0;i<3;i++){
vec2 t = vec2(noise2X(pos)*2.0 + tmod * time * 0.001);
res += wz * snoisesinpow(pos + t.yx, chop);
res += wz * snoisesinpow(pos - t.yx, chop);
w += wz * 2.0;
wz *= 0.8;
pos *= 2.4;
tmod *= 1.8;
}
return res / w;// * 0.5 + (sin((noise2X(pos.xx * 0.001) * 0.5 + 0.5) * pos.x*0.01 + Time) * 0.5 + 0.5);
}
void main( void ) {
//vec2 position = ( v_vTexcoord.xy / resolution.xy );
vec2 position = ( v_vTexcoord.xy );
float color = heightwater(position * 35.0);
gl_FragColor = vec4( 0.65 - color, 0.1, 0.1, 1.0 );
}
* Give the object that draws the shader a 800x608 sprite solid white.
(click to show/hide)Information about object: objCrawler
Sprite: sprBrickBack
Solid: false
Visible: true
Depth: 99999
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
x = 0;
y = 0
uni_time = shader_get_uniform(shdCrawler, "time");
uni_resolution = shader_get_uniform(shdCrawler, "resolution");
t = current_second * current_minute;
Step Event:
execute code:
t += 0.01;
Draw Event:
execute code:
shader_set(shdCrawler);
shader_set_uniform_f(uni_time,global.BlobTime);
shader_set_uniform_f(uni_resolution, room_width,room_height);
draw_self();
shader_reset();
Denferok:
This is very useful, thanks!
WetWookie:
Glad you're getting use out of these.
I just added 16 more blocks and 4 spikes never used in any fangame based on two different colors of stone, acid washed denim and water. I plan to continue making and adding new assets every week or so. Please feel free to request material bases and I'll do my best to accommodate.
Redtefox:
The codes of some of the particles and stuff, what gm is that for exactly? :cirPrise:
Navigation
[0] Message Index
[#] Next page
Go to full version