1/10/2024 0 Comments Stencyl when updatingWill it be possible to forget the list attribute and return to my initial suggestion? Have four game attributes (number): The problem is with the times that are between the times already in the list. If I make a new time that is 150 the list becomes:īut if I make it a time that is 250, the list does not change and continues as it was before I started this new playthroughs: I return to an example similar to what I gave above: I think it is working properly, because the list updates whenever I take a lower time, the problem is when I take time that is in the middle of the times already in the list. In the last scene I have a When updating event with set Final time to Timer (the game attribute that saves time throughout the game). This is because the list assumes that 201 is not less than 200 and because of this the list ignores the value. That is, the code is not working in the correct way, because if we have a list like:Īnd the player makes a time of 201, the list will have to be:īut with this code the list remains the same: If I play the game again and my time is 201, the list looks the same:Įdit2: I think the list is not comparing the times, it is only considering whether the new is lower than the 1st time on the list. As I said earlier, this is already a matter of pride.Įdit: With the new code the problem remains the same. I played again and my time was 109, the list DIDN´T update. I played the game again and my time was 100, the list updated. But the problem with the previous one is that the list only updated with smaller values. Set animation for last created actor to POSITION as text For added effect you can check which entry was updated so you can do something like show a gold, silver or bronze trophy. Otherwise you need to check if a value exists. 999999999999) then you shouldn't need to complicate things by having to check if a value already has been set. That's the basics, and if you pre populate the list with already huge times (e.g. Set Item 2 to LEVEL TIME for BEST TIME LIST If LEVEL TIME < Item 2 from BEST TIME LIST Set Item 1 to LEVEL TIME for BEST TIME LIST If LEVEL TIME < Item 1 from BEST TIME LIST Set Item 0 to LEVEL TIME for BEST TIME LIST If LEVEL TIME < Item 0 from BEST TIME LIST Instead of having them all as separate attributes let's say you have a global list with your times in, at the end of a level you need to check the level time against what's in the list. I hope you can help me and thank you in advance for your time and patience. Can anyone help me? A print with the event would be extraordinary.Īnd then I would like the best three times to appear in another scene, but I think it's just going to use the attributes and the drawing function. How do I assemble the blocks to make this possible? I made several attempts, but couldn't make it. The player ends the game with 24sec, so 25sec has to move to 2nd, 30sec to 3rd, and 24sec now is the new 1st. When the game is over I give it the time the player took to the "Final time" attribute, but I don't know how do I make the times change in the other three attributes?Įxample: The best current times are: 1st - 25sec, 2nd - 30sec, 3rd - 32sec. I think I found a way to keep the best three times (just three, because is more simple), but I don't know how to build the event. Watch decorator does not fire when a component initially loads.I would like to return to the question of the highscores in the "game" I am building. Watch is useful for validation or the handling of side effects. That method will receive the new value of the prop/state, along with the old value. Watch will fire the method it's attached to when a user updates a property, or when an internal state member changes. When a component updates because of a state change (props or state change), the For performance and simplicity, Stencil only compares references for changes, and will not rerender when data inside of an array or object changes. Stencil components update when props or state on a component change.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |