kittiewan's Forum Posts

  • Yes, definitely awesome. Initially I thought I would just be creating prototypes in C2, but it is so much quicker and more fun than my other tools that I can't stop.

  • I couldn't get your example to do anything--just shows the coin. So I created an example to show you where I think the problems you describe lie.

    RandomExperiments.capx

    At the start this example creates a random number of enemies of random colors in random locations. Then every so often (ie randomly) it:

    a) creates another enemy of random color in a random location

    b) randomly selects an enemy and destroys it

    c) have all enemies fire a bullet in random directions.

    d) randomly selects an enemy and has it shoot a bullet in a random direction.

    (EDIT: I added the case (c) where all of the enemies fire at once.)

    Based on your description of the problem with all of the enemies firing at the same time, I suspect that you are doing (c): at random intervals you are (without meaning to) selecting ALL of the enemies and having them fire bullets.

    The other problem you have is that one of your variables is not incrementing. I think you are experiencing first hand variable scope -- that is, the difference between local and global variables. This is a classic bug. Pretty much everyone runs into it at some point. Local and global variables each have their uses, so it is important to understand them.

    In the example I create two variables: LocalVariable and GlobalVariable. LocalVariable is created inside an event or event group each time it runs and is destroyed at the end of the event/event group. GlobalVariable is created outside the group or event and hangs around.

    Both variables are added to every tick and the result is displayed. But notice that since LocalVariable is created and used briefly every time Every Tick is run it only ever gets set to 1. In contrast GlobalVariable hangs around and keeps its value so when it is added to, the number it contains gets larger and larger.

  • You're welcome, but I know you agree with me that sqiddster really deserves the credit for this one.

  • I'm not 100% sure what you're asking, but the following capx has changes to sqiddster's example to use animations instead of frames.

    DonutAnimation.capx

    Just concatenate the result of the expression onto a string to create the animation name string.

  • I just posted an example drag-n-drop matching game in the arcade, with source. Although by default it checks to see if all of the objects are matched, I updated it to also include the option to end the game based on the number of tries. Look at the comments to see what to toggle disabled to switch the end of game test.

    Drag-n-drop-matching-game

    If you have any questions, just ask.

  • Hmmm. They do for me.

    EDIt: This project just uses WindowWidth and WindowHeight to position the ball sprite. When you run this project and left click, does the ball move from center to each corner of the window and then back to the center? If you change the window dimensions and run again does it still work for you? If it doesn't work, something strange is going on...

    WindowSize.capx

  • Clever solution, sqiddster! You seemed to have some duplicate frames (maybe wrong version on dropbox?) so I pasted the correct ones in place according to Joannesalfa's drawings, but in the order to match C2's rotation, as you said.

    Donut2.capx

  • I just posted an example yesterday for someone showing how to get random values out of 1 dimensional, 2 dimensional and 3 dimensional arrays. Uses nested loops to insert values into the 2 and 3 dimensional arrays.

    GetRandomArrayValues.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The problem seems to be that the platform and the player fall at different rates, so the player keeps going into falling mode (instead of standing on the platform.) The player can't jump when falling, so that is the problem.

    Here is a starting point. Uses a doublejump technique to change the player vectory when the player is falling to make it jump upwards again.

    fallingPlatformJump.capx

    You'll need to do something to prevent doublejump when you aren't on the moving platform (if you don't want the doublejump always, that is.) Maybe set a boolean instance variable that allows/prevents doublejump.

    Also there is a growing gap between the player and the platform as it falls that I don't know how to get rid of at the moment.

    PS - there is a boolean on the falling platform that if set to true makes the falling platform fall only as long as the player is on it. In the example I have this turned off for both falling platforms. You can turn it on to experiment with.

  • Can you post an example capx? Or at least tell how your platforms are created. Normally platforms don't fall, so you had to do something to make them fall, like add a bullet or sine or physics behavior or something.

    My guess is that as the platform lowers the player keeps falling onto it, and the player can't jump when falling. You may need to implement something like a double jump to allow the player to jump when in the middle of falling.

    Edit: This thread should help you:

    Jumping on vertical platforms

  • Joe7 showed how to handle a 1 dimensional array. Sqiddster showed how to handle a 2 dimensional array. Here is an example that also handles a three dimensional array.

    Actually, it has 3 arrays: one dimension, two dimension, and three dimension. It loops through all dimensions of the arrays inserting a number into each "cell" and then when the mouse is clicked, retrieves a value from a random "cell" in each array.

    GetRandomArrayValues.capx

  • Could you give us a bit more information on what you are trying to do? Although I don't think solid and drag and drop are meant to work together in the way you seem to think, there are several options that might work. Which one is best depends on what you want to do -- what kind of game, what other kind of objects are in the game, etc.

  • Here are two issues that bug me most with text objects, but also affect some other object types.

    1) When you create an object there should be a way to choose it and set the developer-defined default properties for that object--for example, size, font, color. If there is a way to do it, I haven't found it. I thought if I selected all instances of the object through the project panel it might do it, but no luck. It changes the existing instances, but not new instances.

    2) If you copy an object the changes to the properties are copied to the new instance. When you clone an object it should clone the object with all of the current property settings as the defaults, not clone the standard plugin object. For example, if you have changed the size, font, color of a text object instance, those changes should be the default settings for the cloned object.

  • What simwhi says, except for one thing. I don't know if it changed recently, but for certain in release 87 you can copy sprites and text objects from the layout in one project and paste them into the layout in another and it will copy all of the properties, including instance variables, so you don't have to recreate them from scratch. I don't know about other object types.

  • When I have multiple event sheets I like putting the global variables in their own event sheet because I know exactly where to find them and I don't have to scroll up through a bunch of events to see them. If you want to move the global variables to their own event sheet you can do it relatively easily. I do it all of the time without problems. But it is important to make a backup first and, when you cut the variables from one event sheet, immediately paste them into the other one.

    Step by step:

    1. BACKUP YOUR PROJECT!!!!!

    2. Create a new event sheet. Call it something useful like Global.

    3. Go to the event sheet where your globals currently reside.

    4. Select and CUT the global variables. (Don't copy them or they'll be renamed when you paste.) You'll see an error message that warns you that all of your events/actions that use these globals will be deleted, but not to worry. They won't be deleted immediately, so answer 'Yes'. (You did make a backup, didn't you?)

    5. Immediately go to the Global event sheet and paste the global variables using the paste button on the left side of the toolbar.

    6. Save this new version under a new name just in case...

    You can do this to move the global variables to another existing event sheet, too, but I wouldn't do it just because I didn't want to switch back and forth while editing an event sheet.