zatyka's Recent Forum Activity

  • Whatever version of C2 are you using? The capx was created using release 124. If you're using a previous release, it won't open. I don't think the file being created using the full version would affect your ability to open it. Regardless, there isn't much to the code. Here's a screenshot of the event sheet:

    <img src="http://i.imgur.com/uVwRFKM.png" border="0" />

  • Since your range is circular, you could limit the hero's movement based on the distance between the hero and the movement area. If the distance between the 2 sprites is greater than the range, set the hero's position according to its maximum range and angle compared to the movement area. It sounds more complicated than it is, you just need some basic trig. You can do it all in a single event. Here's a demo and capx with the method using a single event, and the method broken out for explanatory purposes:

    Demo

    Capx

    An added benefit is that there is no collision detection to take up processing power. I hope this helps.

  • ArcadEd's tutorial helped me first get my feet wet with AJAX, MySQL and PHP. It goes over setting up a high score table, but the same principles are applicable to an online save system.

    Online High Score Table (AJAX, PHP, MySQL)

    You'd also need to set up a log in system for users to retrieve their individual save files. To set that up, you'll need to become familiar with MySQL and PHP. W3Schools is a great place to start.

  • zeropad(number, digits)

    Number = the number you want to pad. In your case, this would be the variable representing the hour/minute/second/etc.

    Digits = the total number of digits you want displayed.

    For example:

    zeropad(5,2) results in "05".

    zeropad(141,3) results in "141"

    zeropad(101,10) results in "0000000101"

  • jbmoyer

    Since containers would spawn all the objects as the same spot, he'd still need to have actions to set their properties. It would save a few lines of code if the exact same set of objects spawned for every template. Containers wouldn't be practical if more than one of any object needed to be spawned. I still believe functions are what he's looking for.

  • I agree with Vee41 regarding the webGL effect being the simplest solution. However, this option will only work on webGL enabled devices. Also, you'll need to use a separate sprite for each body part you want colored, and layer them appropriately during runtime.

    Here's an example:

    Example

    Capx

    If it were my game, I'd probably create a few canned color options that are hard coded instead of having to worry about color layers, and webGL enabled devices.

    I hope this helps.

  • It sounds like functions are the right way to go. Create a function for each template, and call one whenever it's needed. For example, create 3 functions, each with a different template, and name them:

    Template1

    Template2

    Template3

    Whenever the played reaches the point that new level elements need to be drawn, use the action:

    call function("Template"&Choose(1,2,3))

    This will call one of the 3 templates at random. You could also do something more dynamic, and add little variation to each template so the player doesn't recognize the pattern. You could go even more dynamic by using a single function, spawn all the objects, and randomly set their properties from a set of values. Of course, this may not be practical depending on your game play. Regardless, I think functions are what you're looking for.

  • As people have already said, there is no perfect resolution that will apply to all devices. That's about as concrete of an answer as you can get. The article that blackout09 linked to explains it clearly:

    common misconception is that you need to target a specific resolution, like 1280x720. However, there are so many different resolutions used that it's ridiculous to pick just one. It's much better to pick an aspect ratio, then scale the game to fit that. For example, instead of 1280x720, target the 16:9 aspect ratio. (Just enter any 16:9 resolution for the window size in Project Properties.) Enable Letterbox scale in the Fullsceeen-in-browser project property, and now your game should appear correctly on any 16:9 resolution. If the display is not 16:9 then black bars appear down the sides, which helps prevent unintended display issues like accidentally seeing too much of the level or menu screen. Note if you are designing a pixellated retro-style game, you may want to use Letterbox integer scale instead.

    his is the same problem faced by TV producers. There are many TVs out there using aspect ratios of 4:3, 16:9 and 16:10. If a producer films a TV show only in 4:3, on a 16:9 TV there will be gaps at the sides, or possibly even unintended off-set equipment and crew visible! Similarly, if you draw a background exactly fitting one display, then run it on another display with a slightly different aspect ratio, gaps will appear at the side or content outside the layout becomes visible. This can even happen if you simply don't take in to account the space taken up by the status bar on devices like the iPhone.

    TV producers solve this problem the same way you should: everything is filmed in the widest aspect ratio 16:9. Then for other displays it's cropped down. For your games, basically you need to make sure you draw your backgrounds wider (or taller, depending on orientation) than the window size, past the normally viewable edges, to ensure no gaps ever appear regardless of the device aspect ratio.

  • Same principle as shifting a value along the X Axis:

    ChangeX = Column to be shifted

    Shift Up:

    <img src="http://i.imgur.com/RfRser9.png" border="0" />

    Shift Down:

    <img src="http://i.imgur.com/YrbkHSX.png" border="0" />

  • zatyka , It would be a huge timesaver if this little detail was added ...

    It would be nice, but my solution works for the time being.

  • Whenever I create a function, I always save its name to a source, like an array, variable, xml file, etc. That way, I can reference that source whenever the function needs to be called so I avoid issues like this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Since all citizens use an identical obstacle map, is there a way of calculating the map once, then applying it to all entities?

    When a path is found, you can access the X and Y coordinates of each node in the path using expressions. I don't know of any way to assign that same path to the "move along path" action, but you can use your own movement system to follow the path. Here's an example I made for someone else, but it should work for you too. The 2nd grouping in the capx is the one you're interested in because it saves the path to an array, which can then be used by other objects.

    Demo

    Capx

    Is there a way of adjusting individual collision map cells, rather than using the in-built "add object"/"re-calculate" functions?

    How exactly would you want to adjust them? I'm guessing you're looking to be able to specify a specific cell, and either change whether it contains an obstacle, or have it recalculate to check if it contains an obstacle. If so, I don't believe there is a way to do this.

zatyka's avatar

zatyka

Member since 11 Aug, 2012

Twitter
zatyka has 1 followers

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • x11
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual

Progress

15/44
How to earn trophies