PixelRebirth's Recent Forum Activity

  • This year there has been a flood of affordable game bundles and sales, which is a great thing if you are a pc gamer.

    On the downside you will end up with duplicate copies of games eventually. I usually distribute them among my friends, but in the spirit of christmas I want to make my current giveaways available to the cool community here at scirra.

    I'm giving away the following steam redeemable games via steamgifts.com:

    Sanctum 2

    Serious Sam 3: BFE

    Trine 2: Complete Story

    Alan Wake Franchise

    Br?tal Legend

    Fear 3

    All you have to do to enter is join my steam group. If you join please leave a comment in the group with your nickname here on the scirra forum. And please do not make a new forum account just to join in. <img src="smileys/smiley9.gif" border="0" align="middle">

    Also be aware that these are steam games and you will need a steam account to enter the giveaways, redeem the game key and play the game.

    Thank you all, merry christmas and good luck!

  • Construct 2 is perfectly capable of doing (almost) anything 2D. Making a blood splatter effect certainly isn't an exception.

    From the looks of it the effect in the video just puts a static blood texture on the ground and spawns a splash texture which is moving in the direction of the bullet and may also be changing size a little while doing so. Does that help?

  • You need to do some editing of the index.html file of your exported project in order to change the background.

    There is a pretty good tutorial about index.html customization which also covers changing the background color: https://www.scirra.com/tutorials/60/construct2-how-to-customize-the-exported-html5-indexhtml

  • You mean you want your regular HTML5 game to be locked to landscape view on mobile devices? I don't think it's possible to force this in browsers.

    However there is a setting "Orientations" in the project properties. You can set it there, but it does also say "if this can be enforced". Best give it a try.

    What you can definitely do is check for the orientation with the browser object and display a warning message if it's in the wrong one.

  • You can use a single global variable (default value 1) which you store via webstorage. When the player completed a level, it will unlock the next one. Meaning that 1 will be added to the variable.

    Now in the level selection screen, you only allow to go to levels which are lower or equal to that variable's value. How this is actually achieved depends on the style of your level selection. If you had clickable tiles representing a level you could add an instance variable called "level" which would represent the level number obviously. Now you could compare this easily to the unlock variable.

    Remember to store the variable in local storage with the webstorage object to keep the progress saved.

  • Give your levers and doors an instance variable called "id".

    Match the variables for the levers and doors that are connected, meaning a lever with the id 4 will open any door with a matching id.

    Of course in order to achieve this you need to add a condition checking for the door id to be equal to the lever id.

  • How bout just using overlap at offset, and getting rid of the array?

    Your suggestion is valid, but my issue was not with finding a different approach, of which there are certainly many. I was just not getting why this exact approach didn't work the way I believed it should.

    But yeah, for anyone looking to do something bomberman-like there is certainly no need for an array.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Now that I'm wide awake and not on my phone I did some tests. I'm pretty sure you'd have to use round() in CC as well. And as far as being just integer values cos(270) is not exactly 0 in either C2 or CC.

    If you set some text to cos(270) you'll get 0, but that's because C2 does some rounding to give you prettier numbers for display. If you set the text to str(cos(270)) you'll bypass the pretty rounding and get -1.8369701987210297e-16.

    In the meantime I did actually recreate the same example with CC and ran into the exact same issue, haha. So I guess I should just shut up and accept my defeat at math. And use round <img src="smileys/smiley36.gif" border="0" align="middle" />

  • Sin, and cos will have some issues when it comes to rounding angles, plus the only time you might want to use it is when those rounding issues would pop up ie diagonals. Catch 22 I guess.

    Right, but this is calculating the following three things for the north direction:

    cos(3*90)*1

    cos(3*90)*2

    cos(3*90)*3

    And all of these should equal 0. Yet I have to put round in front of it for some reason. Is this really something to be expected? I don't recall having had such an issue at any point in my ~5 years with C2 and Classic before that. And cos and sin were being used frequently.

    Also I'd highly suggest snapping your mouse xy with int(mouse.x/cell)*cell +cell/2 for tile games.

    That may be so, but I don't see the relevance here.

  • after quite some testing, I found the problem. Seems to be some sort of computational error

    use

    Function.Param(0)+round(cos(loopindex("boomSides")*90))*loopindex("boomRange")

    and

    Function.Param(1)+round(sin(loopindex("boomSides")*90))*loopindex("boomRange")

    when comparing the value in the array

    Thank you very much for taking a look and nailing the error!

    A computational error indeed, I don't actually think this should need the round expression at all. I mean we aren't even dealing with floats here, all the variables used in the event have simple integer values.

    I found that you only need to apply the round for the X value in the condition, the second one isn't actually needed. I guess this makes some sense since the error only occurs on the left side, meaning at a certain range of X coordinates.

    The X calculation for the 270? angle needs to be always 0 though, which even my calculator agrees on. Yet Construct somehow needs round to make it work?!?

    So yeah, this leads me to believe this might be an actual bug in Construct 2. It could be an accuracy issue with the math expression cos or simply a general issue with that array condition and using math in it.

  • Okay, I wanted to quickly create a little example of a bomb mechanic that works similar to Bomberman.

    I'm doing it using an array storing the obstacles that block the blast (value of 1)and a function that uses a nested loop which creates the blast in the four directions around it(using cos and sin) and only continues the line of explosion if there isn't an obstacle.

    I thought of this implementation as rather elegant. <img src="smileys/smiley9.gif" border="0" align="middle">

    Unfortunately it isn't quite working. In the example you click to create an explosion at that cell position. Now the blast that goes out north (270�) doesn't actually get blocked by obstacles when creating explosions on the left side of the screen. Or it gets blocked where there are no obstacles at all. On the right side it however works fine and all other blast directions also work according to plan (everywhere).

    The values in the array also look fine judging from the debugger view.

    This should be simple, but instead it's driving me mad. I've looked over it a million times and can't figure out why it's behaving so strangely.

    <img src="smileys/smiley19.gif" border="0" align="middle">

    Oh yeah, here is the capx: https://dl.dropboxusercontent.com/u/2306601/bomb_1c.capx

    Maybe it just needs a fresh set of eyes.

  • Seems like Clickteam dropped the tired term "multimedia" and added .5 to the version number, but this still looks exactly like old MMF2:

    http://store.steampowered.com/app/248170

    That event editor still gives me a headache. The only thing it got going for it are the exporters I guess. I also wonder how their HTML5 exported stuff compares to Construct 2, anyone with experience there?

PixelRebirth's avatar

PixelRebirth

Member since 26 Mar, 2008

Twitter
PixelRebirth has 1 followers

Trophy Case

  • 16-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

23/44
How to earn trophies