PixelRebirth's Forum Posts

  • Outstanding. I need to take my time to mess around with this bad boy.

    Thx so much Arsonide for all your efforts!

  • To quote the wiki:

    [quote:uj3k7n3q]When Spawning one object in a Container, new instances of the other objects in the container are automatically spawned and paired up.

    In your EnemyMechanics event sheet you do create both though, the enemy solider itself AND the hitbox. This is resulting in the double amount of enemies and hitboxes you intend to have. And will eventually lead to some kind of mess.

    Just spawn only the enemy with the event and set the hitbox always to the enemy position. This should result in correct behavior.

    And welcome to the forums btw!

  • Very cool addition indeed lucid!

    I mostly made use of the 'Is angle clockwise/anticlockwise' condition and rotated the object accordingly using lerp(like in this thread), but this seems a lot handier.

  • You can test your Browsers canvas rendering speed here -

    http://labs.skookum.com/demos/canvastest/

    Very good link for testing browser speeds. Recently I made my own little test with a Construct 2 creation (link) and it seems like there's no competition for IE9 in the HTML5 department at the moment. I will check if I can confirm this conclusion with this performance test.

  • 2) Make a super which holds a number array (create it using template)

    The super is an array and the number array also. Let's say the super is called 'X' and the number array 'Y'. Then you could (0-based) access it as if it were a 2d array:

    {"X", 4, "Y", 3}

    This seems like a rather odd way to use S, to me at least. I'd propose a level hierarchy similar to the following:

    Levelpack (Super)
    |
    Level (Super)
    |	     |                    |                |
    |       Title (String)       Xsize (Number)   Ysize (Number)
    |
    Tiles (Super)
    |		         |		        |
    Xpos (Number)	Ypos (Number)	Frame (Number)[/code:1acwz8dw]
    
    Setting up templates for your supers. So you can just add a Super for each Tile/Enemy/whatever and it has all the subarrays needed. And yeah, this uses many arrays with only one value actually stored, so it's more like a single variable.
    
    {"Levelpack","Level",2,"Tiles",14,"Frame"} would be the frame of the 14th tile stored in level 2 for example, just to show a bit with an actual S address. To create your level you would of course use the loop conditions of S and spawn objects accordingly.
    
    I do know that S can save objects directly with a spatial info array, but I do prefer to do it with templates holding all the necessary info in any case.
    
    Seems to be like experiences and methods using S can end up being quite different, consider this only my 2 cents.
  • Is there any way I can do this without creating a unique enemy object for each enemy I want to place in my level?

    Of course this would work with instances of the same object. I guess you have a picking mistake in your event setup.

    Like this it would work for example for multiple instances:

    + Evil: Value 'Range' Greater or equal Distance(Evil.X,Evil.Y,Player.X,Player.Y)
    -> Shoot
    [/code:2doqwkrc]
    
    Evil being the Enemy sprite. Using the 'Compare a private variable' condition works great for picking here. It wouldn't work well if you used system compare for the same purpose.
    
    Obviously I don't know your events, but as I said you are probably doing something in a way that all instances actually get picked, although you don't intend to.
    
    Upload a cap or show your events if you're still having trouble with this.
  • I tried the following-

    + System: Always (every tick)

    + System: For each puzzlecubes

    + System: puzzlecubes.Value('x') Equal to puzzlecubes.X

    + System: puzzlecubes.Value('y') Equal to puzzlecubes.y

    -> puzzlecubes: Destroy

    but it didnt work?

    Can anybody help me with this?

    Sounds like it should work. The always event at the beginning is completely unnecessary btw.

    Are you sure the puzzlecube objects reach the correct positions? I mean maybe they end up being at 552.3467 instead of simply 552? Maybe try it like this:

    + System: puzzlecubes.Value('x') Equal to round(puzzlecubes.X)

    + System: puzzlecubes.Value('y') Equal to round(puzzlecubes.y)

    Other than that, show a cap!

  • You could simply have a string containing all your words with the default delimiter.

    car,fence,loophole,bat,cigarette,opium,bottle,wheel,...

    Then if you used the gettoken expression like so

    Gettoken(string,4)

    would return "bat" in case of this example. Get it?

    You could insert a random word easily into sentence for example:

    "He opened the trunk and there it was: a giant "&Gettoken(string,Random(Numtokens(string)+1))

    The Numtokens expression counts the number of tokens, the plus one is there because the Random expression is 0-based.

    Hope that helped!

  • I've tried using left(global('name'), 1) which works fine but I can't seem to get the 2nd letter in the word using left(global('name'),2 returns the 1st & 2nd letters in the word.

    Yeah well, you need to use the MID expression here!

    Mid(string, index, N)
        Returns the N characters after index in string. [/code:3fh2qrg1]
  • I think this issue is important enough to go a bit into detail about it, so here you go:

    We Construct Blog - Forum rescue #002: Timer

  • You really need to do understand picking. In your case you're using the Wait object, well, you're out of luck. A wait action breaks all previous picking. Therefore all instances of the object will be affected.

    As an alternative I would suggest using a private variable, calling it 'Lifetime' or something else that makes sense. You set it to an inital value of 5000 to get the 5 seconds you want (I like to measure time in ms), then have an event that always substracts 1000*TimeDelta from that PV.

    Have another event that destroys the object when the PV is <= 0, and there you have it. A perfectly working 5 second timer without any picking issues.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try adding a File object to your project. It has an action 'Execute file'.

  • Wow awesome thanks ! any ideas on that?

    We all know that one minute has 60 seconds in most cases. With that knowledge, some basic math and a few expressions you should be on the safe side!

    http://dl.dropbox.com/u/2306601/acountdown2.cap

  • There's not much you can change about the button object, I'm afraid. You should try the sprite button plugin, which is more customizable. Or make your own buttons simply with sprites and some events.

  • I?m trying it for 2hours now with no results

    We all started out small, no worries.

    Take a look at this cap: http://dl.dropbox.com/u/2306601/acountdown.cap

    Enter a number in the edit box and click on start to let it count the seconds until take off!