zatyka's Forum Posts

  • While there are undoubtedly ways to make inventories without Arrays, they're really the best option (at least in my opinion). Here's an example I made for someone else a while back. It should show you the basics:

    Demo

    Annotated Capx

  • When you call the function, add a parameter, and set it to the platforms UID. Then in the function, use the "Pick by UID" condition, and set it to the function parameter.

    -Player: On Collision with platform

    -- Platform.trigger != 0

    -> call function "te_" & platform.trigger(Platform.UID)

    • On function "te_1"

    -Pick Platform by UID (function.param(0)

    -> platform destroy

  • ramones

    Awesome! I hadn't considered ordering a loop by a calculated expression.

  • I think you're better off avoiding the "Pick Nearest" condition in this scenario. You could probably somehow use it in conjunction with the "pick all" condition to find the nearest 4, but that seems like a really ugly solution to me.

    There could possibly be a more elegant way to do this, but this is what I came up with:

    Demo

    Annotated Capx

    It stores the distance between the hero and each enemy in an array, sorts the array to find the 4 with the shortest distance, and changes their frame.

  • You're not nesting the scroll action in the "at start of layout" condition, right? If so, it'll only fire once and not every tick.

    This works fine for me:

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

    Edit: I just reread your post.

    then something like every 5 seconds, scroll y to current y -5

    To scroll down, you need to add to ScrollY. Subtracting will try and scroll up.

  • Just to add on to what Darklinki said. Think of the "on collision" as the very first tick that the two sprites are overlapping.

  • Yes, my screenshot used a Boolean instance variable, but you could use a regular variable as well. Think of a Boolean as a variable with only 2 possible values.... True or false. You could use a regular variable instead and use the values 0 and 1 to represent false and true.

  • You need to create it. It's an instance variable I created in the hero sprite. Check out the manual entry on instance variables. Actually, you'd probably benefit by going through some beginner tutorials to get a handle on the basics.

  • The issue is that when you already have a movementArea created off screen. Because you haven't tied the hero to a specific movement areas, he gets tied to the first one that was created (the one that's off screen). That's why he seems to disappear. Add a "Movement Area Destroy" Action at the start of layout, and a instance variable on the hero to say whether he can move or not. This worked fine:

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

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.