paulscottrobson's Recent Forum Activity

  • If by "on screen" you mean on the layout there is a global value for the number of pillars ; Pillars.count

  • Not quite sure what you are trying to do here - you want the laser height to pulse up and down following the sine wave, right ? You can do that by just setting width rather than size. Your actions are having a punch up between each other about who actually controls the height and width at the moment.

  • I'd agree with Yann.

    One slightly misleading claim about C2 is that it "doesn't require programming" ; it doesn't per se, no, but it does require a lot of similar thought processes and organisational skills. Anything of any complexity will require a similar mindset.

  • The thing about LocalStorage is its asynchronous. You can't just do what you'd normally do, read and write data on demand.

    Local Storage is a bit like interrogating a rather slow person on the other end of the phone e.g. to get (say) a high score

    1) Action "Check Item" (Ask it if the high score exists) by key (e.g. "myGameHighScore")

    2a) On event "On Item Missing" (No), set the default high score

    or

    2b) On event "On Item Exists" (Yes), then action "Get Item" (ask what the value of "myGameHighScore" is)

    3) If you asked "Get Item" On event "On Item Get" (Here it is) you can retrieve the actual value (from ItemValue member)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On every tick, if the key is down increase the size by adding or multiplying something to the current size.

    The event thing is run repeatedly every second, so you actually don't want to do anything when the key is up, you just want to change the size when the key is down.

    Do not forget to adjust for dt

  • Well, the problem is that indexOf and lastIndexOf only work on single rows. You could scan through with a loop, but my preferred solution would be to have a key.

    e.g. suppose you have an array 3x2 or more

    Joe, Smith, ...

    Fred,Bloggs, ...

    Jane,Jones, ...

    Now create another array which is a combination of those e.g. a 3 x 1 array, by concatenating the two parts with a semicolon and making it all lower case.

    joe;smith

    fred;bloggs

    jane;jones

    then if you want to search on a pair, you can look for jane;jones in the key array and the index returned by indexOf should be the same as that in the 3x2 array. You have to be careful that if you manipulate the data array, you synchronise the key array with it. Partly how you do this depends how much your data changes.

    This is (incidentally) how you used to do database systems before SQL became popular in the 1990s.

  • The idea, right, is that you extend your laser until it hits something ?

    Your event 3 works, but the problem is it doesn't stop in the repeat to update everything.

    What you can do is

    At the top of 1, Laser set Width to 10 (this sets the initial size of the laser)

    Change 2 to Laser set Height to 2 (if you set the width here it will change it back every time - it goes through the events many times a second - this is the reason the sine doesn't appear to work, you keep setting it back to 2)

    Change the first condition in 3 to "System Every 0.3 seconds" - this means the laser will extend every 0.3 seconds

    Change the Set Width to Laser.Width to 5 - so every 0.3 seconds the laser will be 5 pixels wider until it hits the object.

    This is very slow but it will allow you to see what is going on.

    Construct 2 is event and timer driven. It is a different way of thinking to procedural programming.

  • Hi Mitovo. Looks nice.

    As a general (but not always correct !) rule, if you are duplicating lots of code, there's often a better way of doing it. On your "powerups" for example (event 11) the powerups would be better off in a "family", you can then address them as a unit *and* individually. Powerups are all the same things I would guess, it's only at the point where you create and activate them that they differ.

    If you want to add powerups later, then you'd have to do all this again.

    Similarly for event 21 onwards - you could move the bullet-destroys that are repeated in 22-25 into 21 as you don't ever use them. You can't move UFO.destroy in there, because you need the positions, but because subevents (I think) operate sequentially you could have a sub event 26 which is always executed which destroys the UFO - then if you add a new powerup all you have to do is create it

    Your bullets could be moved into families in a similar way.

    Last but not least, add comments. You might remember what everything does now, but you might not if you want to fix it later on. I've been coding for years (I'm ancient) take it from me, if you don't you'll regret it

  • This is going to sound really odd. I've started using C2 heavily and I really like it , but occasionally my on screen objects in the editor sag. They look like they're drunk almost

    If you can imagine (this actually happened) a sprite font which has two clones (score and high score), one neatly in its box, the other one at the bottom of it and at an angle of 20 degrees or so. It only shows up at edit time, it works fine running and it seems to go away if I close the editor down and reopen it.

    Has anyone else seen it ? Am I drinking too much lager ?

  • Something like this http://www.viewtalker.co.uk/c2/Trees.capx - maintains a count of how many trees there are and makes them to order at a random choice from a spawning point ?

    NB: It would be really handy if I could upload files rather than FTP them ....

  • Thanks, I didn't see that. It is quite small mind

  • I''m not quite sure what you want here. Are you saying you want to destroy your tree and spawn another one when you destroy it, or do you want to spawn one at a later time ?

paulscottrobson's avatar

paulscottrobson

Member since 11 Mar, 2015

Twitter
paulscottrobson has 6 followers

Connect with paulscottrobson

Trophy Case

  • 9-Year Club
  • x4
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Email Verified

Progress

12/44
How to earn trophies