Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2011-07-05 17:35:59

SilverstepP
Member
From: North Carolina
Registered: 2009-07-31
Posts: 1,545

Scripting Suggestion: 'danger_on' 'danger_off'

Maybe if you have an object, you can make it so that a similar thing to 'strong_player' is applied:

'danger_on' - any time the player collides with the object, the player takes damage
'danger_off' - normal reaction to collision

This saves a lot of state switching for things like projectiles that require you to shift back and forth between hurting the player and moving.

I'd say this could go in very low priority, but I'd at least like to see this considered sometime in the future.

Last edited by SilverstepP (2011-07-05 17:36:44)

Offline

#2 2011-07-05 18:01:08

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Scripting Suggestion: 'danger_on' 'danger_off'

you can put a dummy child object that is attached to your object

danger_on = change_child_state "dummy" "on"
danger_off = change_child_state "dummy" "off"

dummy: if my state is "on", then the player gets hit if he or she collides with me.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org