Giter Site home page Giter Site logo

lojemiru / loj-hadron-collider Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 1.0 37 KB

A robust, pixel-perfect collision engine for GameMaker Studio 2.3.

License: MIT License

Game Maker Language 48.83% Yacc 51.17%
collision-detection gamemaker gamemaker-studio-2 gamemaker-studio-2-3

loj-hadron-collider's People

Contributors

lojemiru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

totobal5

loj-hadron-collider's Issues

lhc_bind(xVelVar, yVelVar)/enhanced lhc_behavior_push

Add a binding function to feed x/y velocity variable references into the LHC for use in the builtin collision behaviors. Along with enabling more complex builtin collision behaviors in general, this should theoretically allow for an enhanced version of lhc_behavior_push that manipulates an object's x/y velocity instead of position, allowing for pushables that stop at walls.

This would also require a semi-recursive call of lhc_move(xVel, yVel) as follows:

function lhc_behavior_push_horizontal() {
	var col = lhc_colliding();
	
	if (lhc_collision_right()) {
		variable_instance_set(col, __lhc_xVelVar, bbox_right + (col.x - col.bbox_left) + 1 + __lhc_xVel);
	}
	else if (lhc_collision_left()) {
		variable_instance_set(col, __lhc_xVelVar, bbox_left - (col.bbox_right - col.x) - 1 + __lhc_xVel);
	}

        with (col) {
                lhc_move(variable_instance_get(self, __lhc_xVelVar), variable_instance_get(self, __lhc_yVelVar));
        }
}

Question - Using different masks for different interfaces?

Howdy! I've been checking out the LHC and it looks awesome. I am curious, though - does it have any way to use different collision masks for different interfaces? For instance, using one mask for collisions with terrain and a different one for collisions with enemy hitboxes. As far as I can tell by reading the wiki, it seems like this wouldn't be possible if both types of collision are being handled using lhc_add(), since everything's handled within a single lhc_move() call.

Of course, it wouldn't be a big deal if it's necessary to just make a separate obj_hurtbox that sticks to the player and other things with this behaviour, but I figured I'd ask just in case I missed something.

Static collisions

Forgot about accounting for static collisions in the transition to Interfaces. Whoops.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.