Closed ghost closed 10 years ago
Scripting might offer some interesting possibilities for special little minigames, which could be reused or even configured across different levels. That's pretty common in 2D platformers.
@datahead8888 I want to try to modify the boss levels to show the boss life, since you can get the number of downgrades. Any idea for a good indicator? I can only think of lowering platforms or particle effects or stuff like this...
As for reusing the same sublevel in different levels, we do support that in the Beta 1 thanks to @brianvanderburg2. That was PR #88. I have not tried it out yet, but it should work.
Valete, Quintus
@datahead8888 I want to try to modify the boss levels to show the boss life, since you can get the number of downgrades.
@Quintus, does the scripting API currently allow you to do any kind of graphical drawing? @sauer2, really, the best solution long term is probably to have something implemented at the C++ level, but it could be exposed via scripting. For now, you could have it print some kind of text symbols to denote energy. The old ASCII set had different squares you could print somewhere within the range 128-255; if we're using Unicode I'd assume these are accessible. You could also try some of the things you mentioned, but be careful not to go with something players will think feels hacky.
@Quintus, does the scripting API currently allow you to do any kind of graphical drawing?
Not directly, but you can create a raw Sprite instance with any image you like. Set it to front passive and you can put it whereever you want to have it.
if we're using Unicode
We are using Unicode and you can use all the fun stuff Unicode has. Take a look at the characters U+2500 - U+25FF. I found the gucharmap
program to be a nice Unicode table.
Vale, Quintus
@Quintus Nice, I'll try to create some kind of heart HUD, then.
Do we want to open a github task for long term C++ support for life bars? We also might make the symbol used (hearts, bars, etc) configurable.
@Quintus Is there a way to catch downgrading events?
# delete one on downgrade
UIDS[87].on_touch do
if lifecount > UIDS[87].max_downgrade_count
lifecount -= 1
shrooms[-1].hide
shrooms.drop(-1)
end
end
doesn't seem to work.
BTW: Spawning 15 poisonous mushrooms puts a harsh load on my system. Not sure, if the number of slime particles is particular high or if the emitting system is particular unfriendly to CPU caching.
Is there a way to catch downgrading events?
Currently not, you can only attach to the die
event. Feature for next version I guess.
Nice, I'll try to create some kind of heart HUD, then.
If the font supports that particular character. How would you want to display it? Only thing I can think of currently is using Level.display_info_message
. For using arbitrary sprites, you would have to have an actual graphics file.
Do we want to open a github task for long term C++ support for life bars?
Yes, because there seems to be some objections against life bars, at least I derive that from the IRC discussion.
Also, be careful with the #hide
method. The object still reacts, but is just not visible.
Vale, Quintus
@Quintus
Currently not, you can only attach to the die event. Feature for next version I guess.
Well, that's unfortunate. Also, I'd like to put a remove method on the list.
By the way: At the moment, I'm trying to hide mushrooms for life indicators. http://www.file-upload.net/download-9315187/sauer2_7_boss.smclvl.html Any idea why hiding the mushrooms doesn't work? I'm not a Ruby pro, so does that reference semantics even work?
And last but not least: Any idea about the particles?
At the moment, I'm trying to hide mushrooms for life indicators.
Furball#max_downgrade_count always gives you the maximum number of downgrades the boss requires, not the number of downgrades left. There is no way to determine that currently. Also, use the p
and puts
methods to print out values like that to the console, you will more easily catch errors that way.
I'm not a Ruby pro, so does that reference semantics even work?
The Array#drop method doesn’t modify the receiver. To remove the first item from an array, use the Array#shift method, which will delete it from the array and return it. You might also want to take a look on the Ruby documentation.
I fear that life indicators are not possible with the current scripting possibilities. Something to look forward to ;-)
Vale, Quintus
@Quintus
Furball#max_downgrade_count always gives you the maximum number of downgrades the boss requires, not the number of downgrades left. There is no way to determine that currently.
OK, so the next version, it is.
Also, use the p and puts methods to print out values like that to the console, you will more easily catch errors that way.
Thanks, in fact, I already do that, but it's really uncomfortable compared to real debugging. Mainly, because reloading the level takes some time here.
To remove the first item from an array, use the Array#shift method, which will delete it from the array and return it.
Thanks.
Superseded and resolved by #88.
Valete, Quintus
Most of the levels are pretty long. What do you think about putting in mini-levels (with bonus, minigames, etc) in, like http://www.file-upload.net/download-9312885/pick_up_to_go.smclvl.html ?