bsimser's Forum Posts

  • First off, have you read Arrays for Beginners? (https://www.scirra.com/tutorials/307/ar ... -beginners). It has everything you need to know to create, populate, and retrieve values from arrays.

    Second I don't follow the question as you say you're trying to copy a random name from the first array to another array. You can use the firstnames.At() to get the first name value and copy anywhere you want (even using the Random() function to get the value).

    If you can post a screenshot or a better description of what you're trying to do that might help more to answer the question (if you don't find the answer on the Arrays for Beginners tutorial page).

  • It's pretty simple, answer peoples questions on the boards, post tutorials. I think buying the product will also give you rep. One word of advice, not sure why you're so focused on reputation. It's just a number. Just be a community member and contribute constructively (no pun intended).

  • Here's how I would do it. Seems to work. Attached is the image for the setup.

    Basically the setup is this. Create a variable to hold the SpawnRate. This is the rate your enemies will generate and is based on your needs. 100 per minute or whatever. Whenever your score changes (event #3 in the image) you set a variable named SpawnRateModifier to your Score % 5 (using the modulus operator). This will return 0 if your score is divisible by 5 (so 5, 10, 15, 20, etc.). You also set a value called CheckSpawnModifier to 1 (more on this below).

    Then every tick (event #2 in the image) check two conditions: Is SpawnRateModifier == 0 (in other words, is the score divisible by 5) *and* is CheckSpawnModifier == 1. If it is then you do two actions. First, change CheckSpawnModifier to 0. We do this because we're doing this check every tick. If we didn't set this value and check it on every tick, the second action would keep firing the entire time until the score changed. Then for the second action we add 10 to the SpawnRate.

    So running this, after a few seconds when the score hits 5, the spawn rate is increased to 110 and stays there until the score reaches 10 at which point the SpawnRate is 120.

    Obviously you won't be changing the score every 2 seconds like I did in the demo so it's best to have a function that you call to modify the score and setup these variables at the same time. You can also create variables for SpawnIncrease (instead of a hard coded value) and add that to the SpawnRate.

    Hope that helps.

    Enjoy!

  • Hi guys,

    I have a game where there are 25 screens of maps (the user only sees one screen at a time but they're all connected) and each screen is 20x15 tiles. I started building it with a tilemap then copy/pasted it but now just wondering what's the best approach.

    A single tilemap for the entire game (5 screens wide by 5 screens high = 100 tiles by 60 tiles) or one tilemap per screen? I know the tilesets are optimized but does the system optimize across multiple tilemaps in a layout? Does it matter?

    Thanks!

  • Hi guys,

    Just a note that I haven't posted the code yet. I live in a town named High River in Alberta, Canada and the town was flooded out last Friday. We're doing fine but living in our trailer right now as the own is on military lockdown and I have limited access to internet.

    Thanks

  • Agreed. The other problem with SVN merge is that it's not smart. If you copy a layout it doesn't know to copy the event sheet that's associated with it. Or a sprite with the animations. It only operates at a file level generally.

    Just a quick update I'll post my first cut of the tool on github this weekend (RealLife 1.0 has got in the way this week).

    Thanks.

  • You do not have permission to view this post

  • Not to state the obvious but I was looking through the manual and found the Kongregate plugin page (https://www.scirra.com/manual/136/kongregate) however it's blank. Is there any documentation on this plugin?

  • Like said SVN is fine but it's a lot of merging and manual effort to do something like bring in elements from one project to another.

    I think I get what the intent is here and it's not about project file merging it's really "there's a sprite and a background and a layout I want from project1 that I want to use in project2" and how do I get it?

    Will post code shortly that will do this for you.

    Thanks.

  • mystazsea I thought about using instance variables and the On created event which looks like the only way to do it. However the example I gave wasn't really concrete enough.

    The sprites are blocks and there can be say 5 sizes (32x32, 32x64, 64x64, 128x32, and 128x64). Given a level I want to spawn a random number of each types. I thought I could create a single block (32x32) then spawn it and size it based on say a "blocksize" instance variable (which would be 0-4).

    For example:

    Level 1: 3@1, 2wvn@3

    This would produce 3 blocks sized to 32x64 and 2 blocks sized to 128x32.

    To set it up I use System => On start of layout and set the instance variable (blocksize) to 1 then spawned 3 objects then set it to 3 and spawned another 2 objects.

    Then I setup block On created with a condition when blocksize == 1 and the action to set the size of the block to 32x64.

    This didn't work as everything created is still the original size.

    Without having to create a different sprite for each size I'm not sure how I can do this.

    Why is setting the size on each instance dynamically so hard? I'm sure I'm doing something wrong here.

    Thanks.

  • Hi guys,

    Given an object (a sprite) I added an event on the start of the layout to generate a few of these. The problem is that I want to generate them at different locations and different sizes. The location is easy as it's part of the create object parameters but how do you size the sprite instances at runtime? For example let's say my sprite is 32x32 and I want to generate 5 of this size and 5 at 64x64. I can't imagine I have to create two different sprites in my layout and generate each size separately. The create object doesn't give me back an ID or something so I really can get back to the object to set any properties except going through all of them.

    Thanks.

  • Actually it worked fine for me the first time (Chrome on Windows 7).

    A couple of suggestions:

    1. Include some instructions. I had no idea how to play so I went through about 6 times trying various keys and mouse clicks and I still don't know how it works, what the goal is, etc.

    2. The animations are a little jerky so I would look at lerp functions and other techniques to smooth some of them out

    3. The start and end screen feel out of place with the game graphics. Consider using your main game background as a background for the menus and try reducing the number of fonts used. Maybe a creepy font to go with the theme of the game.

    4. The end screen is a little insulting (especially with no instructions) telling the user the game is very easy. Try to be more sympathetic with the user and encourage them instead of deflating them.

    Fun stuff!

  • bsimser I believe a 3rd party merge utility would certainly be appreciated.

    I have some spare cycles as I'm trying to put together some games (and trying to get things in for the Windows 8 competition).

    I built a quick and dirty reader for the .uistate and the c2project xml file (.caproj) and can merge basic objects right now (sprites with animations, mouse, platform). For an hour or so of work it's crude but works. I think I would need to build my own classes for each plugin and behavior type.

    I'll plug away on this for a couple of days and put the code up on github and we'll see where it goes from there.

    Thanks for the inspiration!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Actually importing a .capx file into an existing project doesn't look that hard. If you rename a .capx file to .zip you'll see it's just a regular zip file. There's a .uistate file that describes what makes up the project, a folder called Event sheets with 2 files per event sheet, a folder called Layouts (again with 2 files per layout). All of the files are in xml/text format so easy to parse.

    I've only looked at a few simple files so importing something bigger might be more challenging and there's the issue of collisions (names, etc.) and following the rules for a project (for example it seems you can only have one instance of a function object).

    The problem is with third party developers I couldn't write a plugin in javascript to do this. First off you don't have access to the file system and I don't know of any zip functionality in javascript. While I'm fairly confident I could write an importer as a stand-alone program it would be nice to hook into the existing system. What would be nice is a plugin model API that I could write a DLL or something and have it call it from a menu.

    In any case, I could do a stand-alone tool if anyone were interested (and the Scirra guys didn't object).

  • I too love the old LucasArts games (Maniac Mansion is my fav followed by Sam and Max, the Indy ones are great too). Construct 2 is pretty flexible so building one of these games isn't too hard.

    Your challenge is loading large screens for backgrounds. While there will be dynamic content and animated sprites for characters walking around, a large part of the screen is going to be static. So on 800x600 this is a lot of pixels in your layout.

    The rest is pretty straight forward. An area to display sprites for commands, a hotspot list of locations on the screen where commands are valid (probably use an Array), sprites for animations and your player character, etc.

    The real hurdle with using Construct 2 for this isn't the technology. These games really have a rich story, vibrant characters, and exceptional game workflow attached to them. So technically you can build one, you really need a strong story behind it before you commit to the tool.