Guizmus's Recent Forum Activity

  • It could be good to see your events to understand why it doesn't work, if you can post a dropbox link, or a google drive link.

    Another way could be to re-position the sprites manually, but it's hard to say why your first try didn't work without seeing it.

    EDIT : here is a capx showing the way saveStates can help you here.

  • Save states will also restore everything else, so it seems the best way to restart the game.

    Using JSON directly was specific to the array here to help save it, but it is the same method used by save states. So you're good :)

  • Without more information, only thing I can came out with is :

    Sprite1 on collision with Sprite2 => System.restart layout

    Of course, this being literally what you said in your post, but with C2 instructions, I suspect there is more to that. Could you tell us what the problem is ?

  • On this, don't forget that lot's of people have either graphical drivers outdated, lots of background process taking most of their CPU and RAM, especially in browsers, where the basic user has toolbars up to the head. "Cleaning" computers everyday, this is a lot more common that some could think.

  • You can either :

    • trigger again the event in the loading event sheet (function may help)
    • save the state of your array at the start of the level (after loading of course) as JSON in a variable, and load from JSON using that same variable's content at the restart of the game.
  • Teclis01

    I did some examples of functions while helping on this forum. I believe this could help you : capx full of comments

    I make use of functions in different ways in the first tutorial of my signature too.

    Yes, having functions is essential if you are somewhat of a programmer. Not necessary for an artist most of the time if the project is simple, but a lot of great things comes from it. You have to understand more concepts though, like UID or else, but it's worth it ^^

    Enjoy your stay in C2 :D

    EDIT : and of course the manual entry !

    Last thing, took me a time to see, but you can rename the function object (F?), making it a lot shorter to write.

  • Ok, I didn't understand that ^^ Let me explain the algorithm then :

    0/ Variables

    CurrentIndex. Initial value : 0. Stores the current index in the array (see below)

    1/ Initialization

    This phase, triggered by the start of layout, fills the array and set the variable to 0. It starts the song. Then, it calls the function "prepareDisplay" in phase 2

    2/ Arrow generation cycle

    This phase is made of 2 functions :

    • prepareDisplay. This function is called with no parameters. It takes the current time of the song, takes the time of the current arrow to display, and waits for the difference, then calls "doDisplay".

    Example, at the start, CurrentIndex = 0. Time of the song = 0. Time of the arrows at the currentIndex (0) of the array is 1,3s. This function will wait 1,3-0 = 1,3s. Then, it will call "doDisplay".

    • doDisplay. This function is called with no parameters. It will take the arrow string ("LT" or anything) at the CurrentIndex in the array, analyse and use it to display new arrows, add 1 to currentIndex, and call "prepareDisplay" again.

    This cycle will make the function prepareDisplay to be called after every time we display the arrows, to wait for the correct next time to work. doDisplay will just do the work, and call again prepareDisplay.

    You will have to add a detection of last arrows of course (end of the array).

    I hope this is more clear. If not, tell me what you don't get ^^

    Btw, this is not really experience with C2, it's mostly how to structure an algorithm. You would do almost the same thing in other languages.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't understand you, and your game didn't work when I launched it (black screen, bits of sprites here and there).

    If you want to position a sprite, you don't position it "Always", you position it "On created". That way every instance of this object will be positioned on creation. Careful though, if the position is the same, objects will overlap and you won't see the new one.

    Last thing, don't bump a post 2h after, there are a lot of posts here, and also rules, stating 24h. If nobody responded, it may also be that you were not clear. After all, right now, I still don't get what Map1 and Map2 are. I though it were different layouts but it doesn't seem so...

  • Having the song segmented in 0.1s will prove to be a problem if you want to go full like DDR, where the unit is under 0.1s, or some arrows are not on this specific beat.

    Your array will also take mor space in memory, but that is not a problem.

    (in my solution, you started the Y index at 1, it's 0 as in JS btw)

    Your solution doesn't require an index. At t=7s, you just check the 70th row of the array, and use it.

    In my solution, to know what row to check, you need to know what was the last row checked/where we currently are in the array. This index would be set to 0 at the start of the song, and you would add 1 after each display. This index would then let you get the next arrows, ...

    In term of CPU, yours is more intensive. There is a call every 0.1s, where mine takes less CPU (a call only when there are new arrows to display), less memory (for the array), but a timer and a variable (for the index).

    All in all, both solutions are valid. They don't have the same flow, and will raise different problems along the way, but your way is totaly valid too.

  • Careful though, browser.title sometime gets modified by spywares or others on the players computer. A key dedicated for each app and stable no matter what is important, so having a constant should be less dangerous.

  • lwgames

    Only thing I saw in your capx was some collision check unnecessary (you check for collisions during the menu for instance), lots of code being evaluated every tick where a function/behavior would be better (for the background scrolling, use a bullet behavior for example, you will spare some events and lighten the logic), some big sprites for the background (I don't see how to optimize this), or some group activation that would benefit the project. All this can be optimized, but shouldn't be a problem for a standard computer. For a mobile device though, changing some of the backgrounds for lighter, more standard sized images would be better.

    The bullet behavior I talked about is used in the "infinite runner" template, you should look at it. it can be used for everything moving on the screen in your game : spikes, backgrounds, ...

  • I would go with Functions to solve this.

    There is a place (or multiple places) in your events where you set this boolean to true. Instead of doing that, you should call a function that would set the boolean to true and then do your actions.

    Example :capx

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies