Kosiam's Recent Forum Activity

  • hard to help with no capx

  • don't forget to check the tutorial links to freeware sprites, textures, etc, there are alot of them available.

  • I think the best way would to be to create a textbox to capture user typing. Then you can act on the input with code like:

    UserText = TextBox.Text

    UserLen = Len(UserText)

    compare expected length of input to UserLen and act accordingly

    parse the string via mid(UserText,x) *note* my testing seemed to indicate 0 based index where to get the first character it was mid(string,0,1)

    so to parse the text when you expect 3+4=7

    if len(UserText)<>5 -> error

    Arg1 = mid(UserText,0,1)

    Arg2 = mid(UserText,2,1)

    Result= mid(UserText,4,1)

    Operand= mid(UserText,1,1)

    SyntaxCheck = mid(UserText,3,1)

    if SyntaxCheck <> "=" -> error

    then have 4 checks for operand to find = "+-/*"

    calculate result via Arg1 and Arg2 and compare to Result

    hope this is clear and helps ;)

  • can you modify the images to show a representation of the main sprite these 2 are following? I'm having a hard time visualizing exactly what you are trying to do.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • trying to use the push/pull method on a multi-dimensioned array will not work unless each dimension is unrelated to the others.

    Also, why it does not work with 4 objects...you destroyed each object as it collided with black, and after 4 were destroyed, there were no more instances available to create from. To fix, I added 1 Red and 1 Blue outside the viewport.

    Here is your better way:

    dropbox.com/s/go1hklpb4hi8u2y/array%20container%20ver2.capx

  • You could use an array to hold your global variables.

    So if you will have 10 maximum ever needed at one time, create an array with x=10, y=1, z=1. Since you are asking for globals, I assume you will be using another layout to access them, so maybe have these layouts load the variable(s) it uses and test if valid, then take action. One way to make valid is if you only use positive values then set the variable = -1 when 'deleted'.

    Another way would be to use any object that has 'instance variables' and set the object to global. Use the instance variables you create as described above.

  • Yep any files added as project files are exported with the project.

    Awesome! I thank you for helping out!

  • ramones

    Thank you very much for that. One question, will that array save file get exported with my project so that when it runs elsewhere the program can load it just the same?

  • oh I see part of the problem, I forgot I had set my window as a sprite on top of the window. I don't see anyway to set the height or width of your window.

  • I tried this out and the logo stays where it starts always. (vertically)

    I'm using FF version 22.0

  • In the example above I had to convert the keycode to a character using a string to hold the alphabet. I'm looking for something like chr() from the real coding world. While doing that example, I couldn't find anything... is there such a thing in C2?

    I looked also, no chr or asc functions. Could probably build functions to do that, but would still require strings. I haven't progressed on the syntax and token commands enough from basic C2 to delve into the plugins just yet, but maybe there is something there.

  • Arrays are underutilized and very favorable for repetitive tasks.

    They can eliminate many logic steps.

    X=floor(random(55))

    array(0-54,0) stores 1st set of data for conditions 0-54

    array(0-54,1) stores 2nd set of data for conditions 0-54

    array(0-54,n) stores n set of data for conditions 0-54

    then using x as the condition variable...plug the values from array into appropriate conditions and spawnings etc...

    spawn array(x,0) Monsters at array(x,1) x axis and array(x,2) y axis with a speed of array(x,3)

    or random x,y, speed....

    spawn array(x,0) Monsters at floor(random(array(x,1)) x axis and floor(random(array(x,2)) y axis with a speed of floor(random(array(x,3))

    taking it one step further, the Monsters spawned could be stored in array(x,4) so that more than 1 type of monster could be picked.

Kosiam's avatar

Kosiam

Member since 28 Jul, 2013

None one is following Kosiam yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies