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 2010-12-23 15:20:50

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

New Command: return_to_previous_state

So that way for items that hit you on contact you can do things like this:

object "moving dangerous object"
{
     requires 0.2.0
     state "main"
     {
               move -100 0
               on_player_collision "hurt"
               on_timeout 1 "move right"
     }
     state "move right"
     { 
               move 100 0
               on_player_collision "hurt"
     }
     state "hurt"
     {
              hit_player
              return_to_previous_state
              on_timeout 1 "main"
    }
}

It would require much less states for damaging attacks on bosses and the like. It would just hurt you then revert back to whatever it was doing.

Is it feasible?

Offline

#2 2010-12-23 15:31:37

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

Re: New Command: return_to_previous_state

SilverstepP wrote:

Is it feasible?

It is feasible, but there is an essential limitation: there must be a maximum number of previous states that the engine can remember. And this number must be small - I'd say 5 at most, since every single object must story its history.

Offline

#3 2010-12-23 15:33:58

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

Re: New Command: return_to_previous_state

Alexandre wrote:
SilverstepP wrote:

Is it feasible?

It is feasible, but there is an essential limitation: there must be a maximum number of previous states that the engine can remember. And this number must be small - I'd say 5 at most, since every single object must story its history.

OK. That should be plenty.

Offline

#4 2010-12-23 16:47:08

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

Re: New Command: return_to_previous_state

Well, I'll make it to the next bleeding edge. It's very, very useful.

Offline

#5 2010-12-23 17:40:59

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

Re: New Command: return_to_previous_state

Alexandre wrote:

Well, I'll make it to the next bleeding edge. It's very, very useful.

Dang! You're working fast!

Offline

#6 2010-12-23 17:52:43

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

Re: New Command: return_to_previous_state

SilverstepP wrote:

Dang! You're working fast!

Due to holidays season, my scarce free time allows me.

And young people have energy.

And this is not too hard to make (but not too easy as well).

And, of course, I expect contributors to keep helping make this game at the times I can't work on it (due to university, etc)

---

It's there: bleeding edge 377
http://opensnc.sourceforge.net/wiki/ind … ious_state

It's untested, so would you help me with this?

(forgot one thing on 376)

Last edited by Alexandre (2010-12-23 18:01:02)

Offline

#7 2010-12-23 18:14:45

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

Re: New Command: return_to_previous_state

It seems to work fine.

Offline

#8 2010-12-28 00:12:59

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

Re: New Command: return_to_previous_state

it turns out that there was a bug with that command, so anyone who wants to use that must upgrade to 403.

Offline

#9 2010-12-28 00:27:08

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

Re: New Command: return_to_previous_state

Alexandre wrote:

it turns out that there was a bug with that command, so anyone who wants to use that must upgrade to 403.

Really? I didn't notice anything weird when i tested it on a custom boss... it seemed to work just fine for my object.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org