Bertie Booster's Forum Posts

  • You don't need the "Else" as the "Player-Weapon==" condition determines which sub event of the condition "On key R pressed" will run. Effectively you are trying to use an Else as an Else/If which isn't quite the same thing but tends to work in C2 as each condition is effectively an "If" condition with a redundant If statement. ie you are saying IF key R is pressed and IF player weapon = Else IF Player weapon = Else IF player weapon =.

    It's much better practice to write it:

    {If} key R is pressed - condition

    {If} weapon = 1=> do something - subevent1

    {if} weapon = 2 => do something else - subevent2

    ELSE do whatever it is you want to do if weapon doesn't equal either 1 or 2. - subevent3

    The easiest way is to add the 8 direction behaviour and then (on the left) adjust this to four directions ie up/down/left/right.

    More aesthetic would be the use of bullet behaviour where it's very easy to control the direction by degrees eg 0,90,180,270.

    The advantage of bullet behaviour is that you could effectively animate the tile movement to give a nice smooth move.

  • Download the Android SDK first then.

    http://developer.android.com/tools/devi ... l#starting

  • Thank's Rabenmutter

    Ashley

    Is this true :

    "Turn off collisions on objects that don't need them"

    Would it not be quicker, easier and more...... educational to simply try it and see what happens?

  • 32px gives a grid of 32X24

    64px gives a grid of 16X12

  • The AJAX object is inserted to the project the same way as any other object such as a Sprite, Tiled Background, Sprite Font, Array etc. It's at the bottom you may have missed it.

    You'll also find one in the same place called Browser, the Browser object will let you execute javascript directly.

  • Add the Ajax object and then you can use AJAX to POST any variables you might want to extract to the URL of your choice eg a MySql db. You can later use Ajax/request URL to bring them in to your new machine from the db.

    (You could just use Fiddler to snatch the vars to a txt file if you don't have access to a server with db but it's that easy to setup localhost with Xampp or similar this should be a last case scenario)

  • Like a father eh then you must say hi to Nicola I mean your mum from me an old friend of the pair from back at the Gym days......... LOL

    I suggest anyone tempted into purchasing a kitchen from whatever Mr Miller company is called today starts by Googling Vance, Nicola Brodie, OFT and Craftsman Kitchens

  • I'm making two assumptions here:

    1) you want the camera to operate solely within the lower triangular area.

    2) Your Layout is in 16:9 aspect ratio eg 960X540 **

    using trigonometry:

    Calculate the diagonal angle to be: 29.358 (trust me) we'll call this 'a'

    from that we can use the tangent of the X value to set the Y value to draw the hypotenuse (your diag line)thus:

    Y=X*tan(a)

    So to fall within the triangular area you want the coordinates must be in the range:

    camera.Y>camera.X*(0.5625) {0.5625 == tan 29.358}

    So the short answer is:

    camera.Y>camera.X*0.5625

    Hope this makes it easier.

    ** Adjust the angle if different aspect ratio

  • A video rather than a book but essential viewing for anyone considering making their own games.

    Sequelitis Mega Man Classic vs. Mega Man X

    Subscribe to Construct videos now

    Warning does contain swearing..

  • Hi, no you're welcome, I had a very quick look, it works but there are issues visible if you use the debugger primarily the block instance variables are wrong.

    First thought is to populate them asap either in a loop on creation or use: System/ on loader layout complete/ for each block/ set OldY to block.Y then do the sums from there......

    And a little tip while I'm here.

    You know you had to include one instance of the block and text boxes, then immediately destroy the block?

    Well you can create a new Layout, call it "Unused" and put anything you want the game to create on it. So long as there is an instance of the object in the game on any Layout used or not, C2 will create the object as expected.

    So technically you could throw a block and the text boxes on an "unused" layout and just use a blank layout linked to the correct event sheet to make this "game" as per your CapX.

    As your games become more complicated you'll find this saves a lot of clutter around the outside of your layouts, very useful with huds etc too as you can design the hud once then just use an include sheet to get it on any layout.

    PS

    Back to your CapX.

    Your block is 50X50 px 100px centres so there is a void of 50px between each stacked pair.

    Try adjusting the point of collision overlap from 100px to 80 or 60 and you'll see the upper block follows the dropping block more fluidly as the dropping block only has to move as few as 10 (instead of 50px) to trigger the secondary drop. Just makes it more visual imo.

    Conversely if you increase the overlap to 124 you can reverse the effect and make it more "blocky"

  • Lots of news, all of it good thanks IntelRobert. I think enabling monetization,ads etc. for C2+Crosswalk through plugins is going to be a real deal clincher for many, it's a little bit of a problem at the moment...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can correct the slight inaccuracies in a number of ways, the way I would use myself (am using in the game I'm currently designing anyway) is to populate an array of the layout with the X and Y values then move up and down the array index read then apply the appropriate value. I've found this to be the best way where accuracy is important and the game is quite complicated.

    But you're new (welcome aboard) so I'll spare you that and show you an easier method which you can use to nail things into position via the bullet behaviour. It's basically the same method as in my earlier post but with a couple of extra steps.

    Firstly your object I'll call it "block" needs an instance variable so create one we'll call it OldY and make it a number.

    Then we need to give the variable a value so we do this at the start of the layout:

    System }

    On start of layout }

    For each "block" } (add the action) Set OldY to block.Y

    // this assigns the current Y value to all instances of the block in the level so you have a starting height.

    Then we skip to the movement.

    As before

    Apply bullet behaviour to block if you haven't already.

    Then:

    Set bullet speed to 100

    Set angle to 90 deg

    Wait 0.5s

    Set bullet speed to 0.

    //Now the extra steps.

    Set block Y to block.OldY+50

    // This sets the new position of the block Y value to an absolute value of its starting position plus the 50 pixels vertical offset that you want. ie nails it into place

    Add 50 to block.OldY

    // Sets the "starting value" of block.Y to its new starting point ie 50 ppx below it's original starting point so if the block needs to move down again it adds another 50 to the correct value.

    So what you're doing on your move is sending it downwards at 100px per second for half a second so it travels 50 pixels before it stops approximately in place then once stopped you shunt it into position the final 2-3 px so it finishes exactly 50 px below it's starting point.

    (If horizontal values are critical just do the same with different angles and another instance var called OldX).

    It's a bit more effort to set up but very easy to use once it is, you could further improve it by putting the movement part into a function and simply calling the function each time a block needs to make that movement.

  • I'm a firm believer in the use of bullet behaviour when you want things to move accurately.

    Apply bullet behaviour.

    Set bullet speed to 100

    Set angle to 90 deg

    Wait 0.5s

    set bullet speed to 0.

    This gives a nice smooth movement and is very, very customisable eg you can have a sprite accelerate to a certain speed then decelerate smoothly into position.

  • Thanks Blackhornet I knew it would be something simple like that jus didn't know what or where.