VIKINGS's Recent Forum Activity

  • Problem is that doesn't always work frozenpeas , I tried it and it was buggy. But cranberrygames plugin(which does the same thing as that checkbox) seems to work flawlessly.

  • Hello World.

    Ok, this might get dizzy so sit down and bare with me please.

    My game has 50 levels and 3 difficulty modes, so I use an array to store the score for width(51):LevelNumber and height(4):Difficulty(I use 51 and 4 becaue I don't want to store at 0,0). "LevelNumber" and "Difficulty" are global variables.

    We have 3 layouts:

    • Main: where you have start game, options, quit, etc. (this is where the game boots up)
    • LevelSelector: where you choose what level you want to play and the difficulty (you are taken here when you press "Start Game" on the main layout)
    • Level 1: the first level of the game

    Now on the LevelSelector I have sprites for all the levels, each sprite has 4 spritefonts on it as follows: first spritefont-the level name, second spritefont-"Easy: ", third spritefont-"Medium: " and forth spritefont-"Hard: " . The layout olso has 2 list objects, one to select your level and another to select your difficulty and another sprite(button) when you press it, it takes you to the selected level and difficulty and sets the global variables for those.

    So you play a level(all levels share the same event sheet) and at the end of the level I have event: If the array value at(LevelNumber,Difficulty) < Score then action set value at(LevelNumber, Difficulty) to Score.(score is another global variable)

    The problem is that now when I come back to the LevelSelector layout, if I want to show those scores I have to create on start of layout a different action for each spritefont!!!!.... so 50 levels x 3 difficulty modes=150 actions....

    Imagine on start of layout:

    Level1Easy(a spritefont object) | Set text to "Easy: " &Array.At(1,1)

    Level1Medium(a different spritefont object) | Set text to "Medium: " &Array.At(1,2)

    Level1Hard | Set text to "Hard: " &Array.At(1,3)

    Level2Easy | Set text to "Easy: " &Array.At(2,1)

    ....

    ....

    ....

    Is there a way to make this retrieval easier without using soooo many actions? Idealy I would want at start of layout to read the variables LevelNumber and Difficulty(which have been set by the level you just played) and then modify the correct spritefont that is chosen based on the number of those variables.

    So what do I do, create a second array for the spritefonts? But then how do I put objects in the correct place in the array without again having 150 events telling C2 what object corresponds to what value.....

    I've been sitting starring at the screen for about 1 hour now and I can't figure this out.....

    Maybe I am overthinking it? Does it even matter(performance wise on mobiles and tablets) if I have so many actions on a start of layout event requesting things? Cause if it's just a "cleaner code" issue I could live without it....

    Thoughts, suggestions?

    Thank you.

  • Do a forum search and get the PhonegapStatusBar plugin by cranberrygame. It does exactly what you want.

  • Ok, cool. Thank you very much guys.

  • Ok blackhornet one more time just to be clear, so I add one just to the width, or to height as well?

    Lool sorry frozenpeas but what you wrote there didn't really help with my confusion.

  • Set animation to random(B1,B2,B3,B4,B5)?

  • 1. K, I figured out how to check it, I was missing it cause I was looking at actions, had to add a subevent first. Thank you linkman2004

    2. Well that's what I am confused about, if I start both of them at 1(and keep going) will all 50 levels fit in an array with width=50? Do I have to start at 0,0 for them to fit or make the array width=51/height=4 if I want to start them both at 1?

  • Try these steps:

    1. Put your background picture in as tiled background, not sprite.

    2. Change it's origin point to 0,0 and then move it to position 0,0.

    3. Resize it so that it's y(if you want height) is twice the size of your layout.

    4. Add a bullet behavior to it.(speed= whatever you want, acceleration=0, gravity=0, bounce of solids=no, set angle=no, initial state=enabled)

    5. Add event: on start of layout>tiled background-set bullet angle of motion to xx degrees(90 degrees if you want it to go down or 270 if you want it to go up)

    6. Add another event: tiled background- y is less or equal to Self.Height / 2 action: tiled backround set y to Self.Y + Self.Height / 2

  • Awesome vids ArcaEd, keep it up please. Thank you very much for everything you're teaching us!:D

  • Hello World,

    So I have to use an array for my score values and this is how I plan to set it up:

    50 levels=50 array width

    3 difficulty levels=3 array height

    3 global variables: "Difficulty", "LevelNumber", "Score"

    Event: on end of layout Set value at(LevelNumber, Difficulty) to Score

    So what I have achieved there(unless I am mistaken) is that every time the layout ends the game checks to see what level you are on, what difficulty you have chosen, and then saves the current score in the appropiate place(level&difficulty).

    I have 2 problems so far:

    1. Is there any way to make it so that the score will be saved only if it's value is higher then what is already in that slot in the array?

    2. I am confused by the following quote from the manual:

    "Note like the rest of Construct 2, indices are zero-based, so the first element is at 0. In this example, Array.At(0, 0) would return the first number in the grid."

    What exactly does that mean? If I put 3 for my array height, does that mean I have 4 columns, one for 0, one for 1, one for 2 and one for 3? And where exactly do I store my values... cause I would like level 1 to be stored at x 1 in the array. So if you play level 1 on easy difficulty(lowest possible) then the value would be store at x:1 and y:1 in the array; would all 50 levels fit then if I don't use the 0,0 thing?

    Sigh, I am totally confused by this part, guess that's obvious.....

    Please help, thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Looks similar to what I want LittleStain , but I'm not sure that that one uses the right algorithm for what I want to end up with.(still shopping around for the right algorithm)

    Ok.... I'm a bit confused Lordshiva1948 , what am I supposed to download from that list?

  • Hello World,

    Is it be possible to create a randomly generated maze with C2? And if it is, how would one approach doing such a thing? After a quick google search(I'll have to do a more serious one later) I was thinking of maybe using the depth-first search algorithm.

    Check THIS link out, scroll down and you can see a video of the depth-first search algorithm in action.

    So how would I go about doing such a thing? What plugins would I have to use? Maybe there already is a plugin that does all the work for me? Would I have to learn&use functions with it? Can I just trow togheter a couple of events that mimic what the wiki says about how this algorithm works? What's the process?

    As much info and detail you guys can give me would be very much appreciated.

    Thank you.

    P.S. Of course there are a lot of other questions that concern me and need be asked. For example how would the current mobile hardware handle this, would it take a long time to generate a maze? I know it already has problems with pahtfinding in that regard, and this seems to be much more complex. Another issue would be that while it draws the maze it would have to attach sprites to it's "walls", would that be doable?

VIKINGS's avatar

VIKINGS

Member since 13 Feb, 2014

None one is following VIKINGS yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies