PixelHero's Forum Posts

  • I would use a function. If you have a DestroyAllEnemy routine, you can call it, which will operate without the have a sprite picked.

    Then you can just CallFunction from your On Collision event. Plus, it's reusable.

    Here, here's a simple example:

    db.tt/3pxTNdBM

  • Just gave it a try.

    Turns out, the setting sticks, no need to do it every tick. On object created/layout loaded, etc works just fine!

    Cheers and thanks!

    ~Complete CSS NOOOOB

  • tumira

    If it supports .Net4.0, I would expect it to be based on C# 4.0, and support LINQ.

    Yeah, I need LINQ if I'm in C#, I live and breathe Reactive Extensions.

    I have to laugh, though. I've used the docking architecture before, and contributed to it somewhat <img src="smileys/smiley1.gif" border="0" align="middle" /> (well, a derivative of it, since WeifenLuo stopped updating it.

    Then we moved to WPF and redid the user interface, but hey!

    Thanks for the heads up!

    *Edit* Something screams out as very wrong when you are better off downloading from the forums than the main page.

  • The simplist way is to use an image button, instead of a regular button.

    scirra.com/forum/plugin-image-button_topic51829.html

    However, one other option is the "Set CSS" under appearance, since the text is rendered HTML5. You can use all of the properties here:

    w3schools.com/css/css_text.asp

  • PixelHero why bother to get 2 extension such as playmaker and uScript?

    Well, if we're talking about the capabilities of Construct 2, event sheets and visual scripting of actions come to mind. You don't need them in Unity, no, but it at least comes close to some of the main features of Construct 2 (other than the built in 2D, of course). I was trying to convey that you could replicate some of the main features that set Construct 2 apart from other 2D engines for the same price as buying Construct 2.

    *shrug* Not trying to recommend or tell people what to buy.

  • Honestly, I hope they never finish C2 (although they need an additional revenue stream from us, to be honest).

    There are some great 3D platforms out there. $100 on the Unity store will get you a great state machine (playmaker) AND a visual scripting platform (UScript) that replicates a lot of what C2 offers, and throws in a state machine on top that is really quite powerful and has built in handling of 3D object actions.

    For me personally, I prefer Construct remain 2D. I want to make awesome 2D games. Yeah, some of that comes from my complete failure to ever understand how to texture, bump, specular, diffuse, normal 3D objects that I'm pretty terrible at making anyway.

    But that doesn't change that C2 fills a niche, and fills it well, in my opinion. And it just so happens that right now, that niche is what I want to develop towards.

    If Construct went 3D, I just feel like it would get drowned out by some of the big names.   There is simplicity in 2D, and Construct aims to make game development simple. Maybe not easy, but simple.    <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I use C2 because I actually really have a shot of finishing my games.

    I don't really get why, but I don't mind it really. I'm a C# developer and there are times where I REALLY miss the multiple interfaces, reactive extensions, object references...

    And not one of those that I've worked on with any other platform has progressed beyond " a few things on screen and lots of data classes". I had one in XNA I finished, but that's dead now... I've used Unity, I have lots of assets, but I never really get in more than those first few days where you have a cool idea and work feverishly on it.

    I don't really know why, but I find C2 fun to use. So I'm coming from the opposite end. I'm a professional developer, that's worked with platforms like Unity... and I'm going a new direction with C2.

    I'm not saying you're wrong, not at all. Every tool has its strengths and there are many things that C2 isn't really good at. But I'm loving C2, and I hope that never changes.   <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Hmmm...Yeah, I was assuming a return to idle before going in the opposite direction (no button press), but there's not necessarily anything in the code to cause that, and it would be bad to assume.

    Wouldn't the same thing happen with yours C-7?

    If W is down set animation to north

    --subevent: if a, set animation to north,

    --if d, north

    --if s, south.

    ...

    If S is down set animation to south

    --subevent: if a, set animation to south,

    --if d, south

    --if s, north.

    then the animation is the north animation, regardless of which key was pressed first.

    I think I'm missing something.   <img src="smileys/smiley1.gif" border="0" align="middle" />

    taborgreat, that's probably because of the order of your events. If you reorder them, do you get an issue with a different direction?

  • If I understand correctly, I would add an instance variable to the player that indicates the player is moving. Then when a button is pressed, check to see if the player is already moving. If they aren't, set your animation going and set the moving variable

    On future button presses, they check to see if moving, and the player is already moving so they skip the animation and press on. You character still moves in the correct directions, but you only set the animation to play if no movement key was being held down prior to the button press.

    That should prevent animations from overriding each other, which is what I suspect is happening here. What you have described is "undefined" behavior, meaning the exact outcome depends on which order you test the movement keys determines the final, actual, animation.

    At least I think. If what I'm saying doesn't make sense, can you post a .capx? We'll be happy to take a look at it (I wouldn't imagine it would be hard to make a new project, copy the player and the movement key events).

    Hope it helps!

  • PixelHero here!

    I'm a professional developer (C# and WPF, though I end up supporting legacy C++ applications a lot where I am), and a hobbyist game developer.

    As a kid, I always though making a game would be fun, but I never really looked at the games industry as I got older. Waaay back I used DarkBasic (back before they had Pro), although that never really amounted to anything. Then I dabbled in XNA, and finished the only game I've ever really made: a clone of Arcomage from Might and Magic VII and VIII, though it used the original art assets, so I was never able to release it. But It was actually a complete game, including an AI opponent with fairly complex rules as to how it would play. It even won sometimes.   <img src="smileys/smiley7.gif" border="0" align="middle" />

    Then I dabbled in Unity (before they had a built in 2d toolkit), which is a natural fit for me since I really enjoy working in C#, and I have a fairly large bag of tricks there. But it just... never really worked with 2D for me. I tried a couple of 2D toolkits, and they help with the atlasses, but I just found it difficult to make 2D games with it.

    So even though I know programming, and it at times is difficult for me to set aside my OOP training, I find myself having fun in Construct2 and actually continuing to develop my ideas. Which is a novel concept for me. :-)

    Oh, and I STINK at art and assets.   I can do 3D sculptures (I use sculptris) though, so maybe I should make some digital boardgames....   hmmm

    Sorry, I have yet another idea I need to write down...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The common use of Lerp actually hides what the math is doing. LERP is a linear interpolation between two values, where a decimal number between 0 and 1 describes how far along the scale the value lies.

    So, for example,

    if you scale is 0-100, a value of .3 indicates that the value should be 30. Percentages! But of course, we can use other scales, so a scale of 654 - 1782 with a interpolation value of .3 is 992.4.

    It works out to:

    (high - low)* interpolation + low.

    Now, the common use in Construct 2 is to achieve a smooth curve approach to a value, such as a camera target. That way the camera smooths into the value, rather than having an abrupt end. If we look at the math:

    Say we had our 0-100 example, with the .3 interpolation value.

    First loop:

    0-100, .3 gives 30. So we set position of the camera to 30.

    Next loop:

    30-100, .3 gives 51. So we set position of the camera to 51

    51-100, .3 gives 65.7.   So we set position of the camera to 65.7.

    Etc...

    Now, what ends up happening is that eventually the camera is moving by very small steps per step of the logic. But we are feeding the result of the previous step back in as into the logic to get the next step. Eventually, the camera starts moving by less than an integer per frame, which means that if you floor that value, it stops moving entirely, because every time the floor is causing it to reset the value to what it was. (going from 941, to 941.87, which gets floored back to 941, in your case, for example)

    Now, it is a good idea to have an end condition for the move, to prevent small minute "drifts" of the camera. This can be achieved by having a condition to check if the distance between the camera and the target is less than some critical distance. If it is, snap it to the end value. Too much and you'll see the snap, too little and you'll get minute pixel shifts of some of your sprites, particularly if they have non-integer positions.

    Hope that helps!

  • That probably is happening because your event sheet isn't picking a door instance. If you don't have a specific instance picked by an event, then the action happens to ALL instances.

    So for instance, something like:

    * System | On start of layout

       local variable newDoorID = 0

       * System | For Each [] Door

            Door[] | Set doorID to newDoorID

            System | Add 1 to newDoorID

    This will cause each door to get a unique ID at the start of the layout. If you want globally unique door IDs, then just make newDoorID a global, rather than an instance of the on start layout. You can also do a for-each ordered if there is another criteria that you want to use to determine the IDs (such as position along the x axis, or something)

    If you want, you can also save the level to load in a text instance variable on the door, and then use common code like the following (you'll have to add in the stat saving and all, sorry)

    * Keyboard | On [use your key here] key pressed

       * Player | is overlapping [] Door

       * Door | X Is Locked                           //Just an example

          * System | Go to layout Door.levelToLoad

    For an example. Of course you can spruce it up, but at least then you don't have to do any custom mapping of doors to levels.