Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projectiles now respond correctly to floors #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/article19_init.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//article19_init, Floor Supporter, By floralQuaFloral

// visible = false;
sprite_index = sprite_get("projectile_supporter"); depth = -90000000;
image_xscale = 2;

var repetitions = 0, par_block = asset_get("par_block");
while repetitions < 100 && !place_meeting(x, y + 1, par_block) {
y++;
}
image_yscale = 4; //adds a bit of thickness to the floor just in case
3 changes: 3 additions & 0 deletions scripts/article19_update.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//article19_update, Floor Supporter, By floralQuaFloral

instance_destroy();
2 changes: 2 additions & 0 deletions scripts/load.gml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ sprite_change_offset("stall",27, 48);
sprite_change_offset("marble_ground",-32, 0);
sprite_change_offset("black",-32, 0);

sprite_change_offset("projectile_supporter", 1, 0);

//Need to set sprite collisions here!
//Ouside Left
sprite_change_collision_mask("g_ground",true,0,0,0,0,0,0);
Expand Down
24 changes: 24 additions & 0 deletions scripts/update.gml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ if !_init {
}
if get_gameplay_time() == 3 with oPlayer {

//Fix Sylvanos's hitboxes (if we do this in other_init.gml, the game crashes??)
//Might as well do it here...
if url == CH_SYLVANOS {
set_hitbox_value(AT_NSPECIAL, 1, HG_PROJECTILE_GROUND_BEHAVIOR, 0);
set_hitbox_value(AT_FTILT, 1, HG_PROJECTILE_GROUND_BEHAVIOR, 0);
}

// if taunt_down {
// with other {
// debug = true;
Expand Down Expand Up @@ -92,6 +99,23 @@ if !_init {
//if taunt_held == 10 other.debug_console = !other.debug_console;
}
var wall_here;

with pHitBox if type == 2 && grounds != 1 && vsp > 0 { //Make projectiles respond correctly to floors
//Save the old size & mask, then switch to the ones appropriate for collisons with terrain
var saved_mask = mask_index, saved_xscale = image_xscale, saved_yscale = image_yscale;
mask_index = (collision_sprite == 0)?sprite_index:collision_sprite;
image_xscale = 1; image_yscale = 1;

//Check for collisions; if we're about to hit a floor then spawn a temporary rectangular floor
if place_meeting(x, y + vsp + 2, asset_get("par_block")) {
instance_create(floor(x + hsp), floor(y), "obj_stage_article_solid", 19);
}

//Reset size and mask to normal values
image_xscale = saved_xscale; image_yscale = saved_yscale; mask_index = saved_mask;
}


with oPlayer { //Fixes for various things due to article solids
if god {
invincible = true;
Expand Down
Binary file added sprites/articles/projectile_supporter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.