kittiewan's Forum Posts

  • There are many ways to do this. I've included 2 ways in this capx. (One is toggled disabled. They both produce the same result, but there might be a use for each. The first is easiest to understand.

    RandomHealth.capx

    Variables are used for all of the health range limits, so if you want to change the health range levels you just change the values for the globals. In the comments I included your original numbers so that you can see more easily what is going on.

  • I think what you want to do can be achieved, but if I were doing it, I'd get one player doing exactly what I want before I'd try to add in the others.

    When I ran your example, it switched back to the idle animation everytime the characters returned close to their starting point, which is what your events seems to be telling it to do.

    To handle multiple lifebars I added a sprite called lifeline with a pin behavior and had each player spawn one, and then in turn the lifeline spawned the frame and lifebar. Of course you would set the lifeline to invisible for actual game.

    multiPlayers.capx

    As far as the speed, what kind of game is this supposed to be? Is there a reason you can't use one of the standard behaviors, like 8 way or platform to control the current player? (You would disable the behavior on the other players and only enable it on the current player.) For making a prototype that would go much faster than trying to create a custom movement. You can make it look a little cooler by creating custom camera movement using some lerping with scrolling rather than having the lerping in the movement.

    I assume that you've read Ashley's ghost shooter tutorial which is the starting place for understanding C2. It uses the 8-way behavior.

    If your game is a variation of a platformer, have you read velojet's tutorial

    Building a platform game - a beginner's guide? I learned a lot from that.

  • Yeah, I like Construct 2 because it clicks with the way I think better than most of the other tools.

    You're probably right that you are overthinking a bit, but it takes time to wrap your mind around this stuff. In my experience, one has to experiment a bit and break a lot of things before it starts really making sense.

    If you used Bunnystep, you wouldn't be creating all of the platforms. That was just what my example did to show how autogeneration of a level could be done.

    To blow your mind a little more, I present BunnyRun:

    BunnyRun.capx

    Yes. BunnyRun. Heh, heh. It is a combination of BunnyHop and BunnySteps, more targeted to your actual case. There is one layout for the levels, with different backgrounds depending on the level number. Also the number of points required to get to the next level gets higher each level. (the points are sort of like your monster kills needed to get to the next level.)

    Also, between levels there is a store level with its own event sheet. The player does some stuff and then clicks a button to go to the next level. If there are no more levels "The End" is displayed instead of the store, but you could display the store again, or whatever you want.

    There are comments in this one that may help you understand it better.

    As far as the problem you were having with BunnyHop first level, I think you may have run the game after going to a different level, or perhaps I saved it that way. Go to the Level 1 tab and then run the game and see if it is better. You can specify the first layout in the property panel for the project, but when you click the Run button inside C2 it starts with the last level which is very useful if you just want to test that level, but it can lead to some odd behaviors.

    re the txtMessage, you asked where the "complete!" comes from and what does it do?

    It is just a string. You could just as easily say " finished!" or anything else.

    txtMessage "set text to "Level" & LevelNumber & " complete!"

    will just display "Level 1 complete!" at the end of the first level,

    "Level 2 complete!" at the end of the second level, etc.

  • You figured it out on your own. I was just going to point you to this nice example by gammabeam:

    Multiple Resolutions - Solid example

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What you are doing basically works, but it isn't particularly elegant or efficient.

    I've included two examples for you to look at, including the intermediary screen between levels.

    BunnySteps.capx

    This one only has one layout and one event sheet that keeps getting called over and over, but a new, very simple level is autogenerated each time. The message between "levels" is actually just another layer that is hidden until it is needed. I think there are something like 15 or 16 levels generated before it ends.

    BunnyHop.capx

    This one has 5 different layouts. One of them is the intermediate message layout that is displayed between levels. The other four are different levels. However, there is only one event sheet shared by all of the level layouts, and one used by the message layout, and another exclusively for declaring global variables. Putting the globals in a separate event sheet makes it easier to share the event sheets between levels as well as easier to find and modify the global variables. You could easily add more levels by just creating the layouts named "level 5", "level 6", etc and changing the global variable NumberLevels to correspond to the last level. You also need to set the event sheet for each layout by clicking on the layout name in the project panel to select it and then changing it's event sheet in the properties panel to "Level Events".

    If you like one approach over the other and have questions about it, I'd be happy to try to answer them. Good luck!

  • Interesting. I thought an instance of the object had to appear in every layout where you planned to create/spawn it, but you are right. It only has to appear in one layout and can be used by all others.

    Now that I think about it, I recall what you are calling a template layout referred to as an "object bank" in Construct Classic--probably in scidave's Mikey's Adventure tutorial. Don't know why I didn't make the connection despite Newt's numerous explanations.

  • Kyatric: I used to ignore them too, but right around the time I started hearing the radio signal through my dental fillings I realized that was probably a misguided and possibly dangerous thing to do.

    zsangerous and sheepy: Seriously, there could be characters like a space that don't show up for me but get changed to something else for you (like %20 which gets changed to who knows what. So I made sure the new link is as trimmed as I can get it. What operating system are you using? I'm using Win 7.

    BTW, I used Construct 2 R84 for the example.

  • It's working for me, but maybe there are some hidden characters in the URL that kyatric and my OS ignores. I got a new dropbox link and pasted it in, so you might try once more.

    MonsterTag.capx

  • Are you saying you want a timer that counts down to zero? The game is over when the time runs out?

    Did you see the Time Counter tutorial by CodemasterMike? The link to the .capx file is down in the comments.

    Also he made a clock plugin that does the same things.

  • In case someone else is having this problem, Kyatric fixed the links so that the videos showed up, although only at a small size. The code he used is:

    [tube:GoF6KQjM4ns]

    where "GoF6KQjM4ns" is the code for your youtube video. (That's the code for one of my videos. You'd use your own code!)

  • still haven't heard from scidave. For those of you who are interested, here is a link to the "ported" part 2.

    Mikey

    MikeysAdventure_pt2_noInventory

    I'm holding off on the other parts because I want to use the new array features in C2 release 85, and haven't had a chance to play with them yet. They should make it much easier to manage the inventory array.

  • I was able to download and run it. Sometimes when capx files download they are treated as compressed (zipped) folders. If that happens you would extract them to an uncompressed folder and then run.

    Here are some pictures to show what I did. First the layout. Note that the feeler object has a pin behavior. The player object has a scroll to and an 8-way behavior set to 4 directions only. The monster has a boolean instance variable Following.

    <img src="http://dl.dropbox.com/u/57899112/MonsterTagLayout.PNG" border="0" />

    And the events:

    <img src="http://dl.dropbox.com/u/57899112/MonsterTagEvents.PNG" border="0" />

  • heh heh. This isn't exactly what you describe, but it is kind of fun to play with!

    The monster has a "feeler" pinned to it. If the feeler isn't over the road the monster can't move. The monster always turns towards the player, and when the player trips the trigger (overlapped point) the the monster starts following the player--as long as its feeler is overlapping the road!

    MonsterTag.capx

    EDIT 1: Right now the monster is set to move forward 5 pixels every tick, but if you dial that down to just 1 pixel, the monster actually follows the road pretty closely, so it is almost exactly what you were asking about.

    EDIT 2: You would make the monster's feeler invisible in the finished game, of course.

  • My preferred approach is to use WindowWidth and WindowWidth to arrange objects:

    Set the text object's horizontal alignment to center in the properties panel and then in the event sheet, if you want the text object to be on the bottom center of the window:

    On start of layout, set text object's position to:

    x: (WindowWidth - self.Width)/2

    y: WindowHeight - self.Height

    This works for any object, not just text. If you wanted the object right in the middle of the screen both vertically and horizontally,

    x: (WindowWidth - self.Width)/2

    y: (WindowHeight - self.Height)/2

    For the buttons, check out part 2 of my tutorial on Creating a Memory Match Game. It shows how you can arrange a layout of cards that resizes and rearranges if the window size changes, but the technique would work just as well for buttons.

    EDIT: You can read about the Anchor behavior in the manual, but I don't think it works well for centering.

  • To those non-US developers, I wouldn't read any disrespect or disinterest into this. As a former software product manager, my guess is that John's asking about US developers because that is his assigned market, and he has little or no authority outside that. A program like he is suggesting has to start somewhere and if successful, it grows into other markets.

    Anyway, I'm a US developer, and I would be interested.