Somebody asked me how I did the level progression in a game of mine. I added a zip of a bbdoc here. I have not used code, I used the send and receive nodes. It works on my game, but it may not work for all the projects. Maybe someone will find it useful.
@Tars Tarkas your solution is very clever, but I do not have a finish object at the end of the scene to complete a level with coins. I added event observer on game UI to track level completion. So the Level Selector Node has a NEXT option, tried to plug that one out to if Collide with Coin (selected) instead of finish object you had. Did not work. My "Next" level option is Event Observer in UI, I cannot link that into the Node.
Well, it looks like the Level Selector node is not being used on progression.bbdoc. Here's my simplified version of it, see attachment to this post. Change log: - Removed level selector node - Removed Defeat nodes in Progression asset - Added progression in UI, instead of the 3D world.
I added it in the world because if i added in UI I don't have a stick to edge option, it might not show depending on your screen adjustment setting
@Tars Tarkas On Progression asset, I have: - Receive, Event Name 1 - Receive, Event Name 2 - Receive, Event Name 3 Code for each Receive Node: Code: /// var eventName; var eventCallback = function(val){ this.emitSignal('Out', val); }; function init() { eventName = this.attribute('Event Name'); eventCallback = eventCallback.bind(this); } function start(){ Event.addListener('eventName::' + eventName, eventCallback); } function onRemove(){ Event.removeListener('eventName::' + eventName, eventCallback); } function update(dt) {} function signal(name, value) {} On Point asset, I have: - Send, Event Name 1 - Send, Event Name 2 - Send, Event Name 3 Code for each Send Node: Code: /// var eventName; function init(){ eventName = this.attribute('Event Name'); } function start(){} function update(dt){} function signal(name, value){ Event.fire('eventName::' + eventName, value); } Can you now reproduce this progression bar? It seems like I cannot figure out a way to SEND multiple signals separately and execute each separately when the point collides with character. I need to link SEND with Event Name 2 and SEND with Event Name 3 as well. Please check the bbdoc attached here.
Yes it's easy. Check the file I attached. Go to the point object and click the send node. You will see next to the Event name a pin icon that is pressed. This way you can change the name for that event inside the world. I changed them to 1, 2 and 3. That featured is very useful, you can find on every node, for example if you want an object to rotate, you press that and you can duplicate that object in the scene and have it rotate at different speeds. I did not notice it at first either. Also that defeat node made sense in the first file I added. If you don't want to remove the point after you collide with it, the defeat node it's necessary.