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

Kills enemies when using the on off switches #667

Open
Alexis0159 opened this issue Nov 26, 2024 · 1 comment
Open

Kills enemies when using the on off switches #667

Alexis0159 opened this issue Nov 26, 2024 · 1 comment

Comments

@Alexis0159
Copy link

Alexis0159 commented Nov 26, 2024

It would be nice if the on/off switches could kill enemies in Mario Maker physics.

`function buttonblock:change()
self.solid = not self.solid

if not self.solid then
    self.quad = self.quadoff
    self.active = false
else
    self.quad = self.quadon
    self.active = true
    for _, obj in pairs(objects["enemy"] or {}) do
        if math.abs(obj.x - self.x) < obj.width and math.abs(obj.y - self.y) < obj.height then
            if obj.shotted then
                local dir = (self.x < obj.x) and 1 or -1
                obj:shotted(dir)
            end
        end
    end
end

end
`

Mari0_.AE.2024-11-23.17-02-16.mp4
@greatbritdan
Copy link
Contributor

This should probably take into account enemies with "resistseverything"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants