AllanR's Recent Forum Activity

  • there may be a way to paste map pieces into a drawing canvas and then apply an effect to get an outline around the group...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It might depend on how long you play, what other tabs are open, what extensions are active, what order things happen in the game. It could be that some change in Chrome made the issue more obvious now for some reason, or something else on your computer changed.

    pretty much every time I have looked into an issue like this, it was because I (or someone else) forgot to destroy explosion instances, or millions of bullets were flying off to infinity, or particle instances were adding up, or some condition was true that continuously spawned an object, and the increased number of objects was bogging down collision checks, etc...

  • MTR

    I tried a few ideas I had, but didn't get very far...

    see this thread from 6 months ago where I made a sample that did something similar (but not outlining the total area):

    https://www.construct.net/en/forum/construct-2/how-do-i-18/check-mouse-sprites-139913?kws=france.capx

    I thought you might be able to use scale to make copies of the occupied map pieces, tint them to the border colour you wanted and move them under the real pieces so just the over-all outer edges were visible, but because of the irregular shapes, scale did not produce an even outline. So, that means you will probably have to make two copies of each map piece - one without a border, and one with a border. And then have two layers of pieces - with the pieces with a border under the ones without. The main problem is what happens when two players' map pieces are side by side - which way does the border extend? if the border does not extend past the edge of the map piece, then you will need border pieces for each edge of each piece and work out what to show.

    you could also try putting image points all around the map pieces and use that to calculate where to draw a border, but that wont be easy either...

  • CrudeMik

    I would run the game in debug mode and see if you are adding more and more objects (bullets, or enemies, or loot, etc.) I bet something is building up in the background that isn't visually obvious.

  • minipill

    event 2 checks for a collision between "weapons" and "player"

    but then in sub event 6 you are moving the weapon and pinning it to "Sprites" family. But there is no Sprites family picked, so it is not using the one you want.

    in event 6 move the weapon and pin it to the player family instance (which is picked because of the collision triggered in event 2).

    You are on the right track... it is a good idea to pin images on top of a hidden player object - that allows you to customize the character, change armour, weapons, etc. But you should always pin everything to the base player object, otherwise there is a slight lag when things are moving which doesn't look good.

    (so, you don't want to pin a body to the player, then pin an arm to the body and then pin a weapon to the arm...) pin everything to the player, and they will all move together the way you want. But that can cause issues with being able to animate things the way you want. If you need complex moving of multiple parts, then you should use something like Spriter.

  • minipill

    EDIT: I didn't refresh the screen so I didn't see the other replies while I was playing around...

    what is happening is not quite what you think.

    when a player collides with a weapon, you destroy the weapon and spawn a new one on that player.

    however, when you spawn an object from a family, you get a random member of that family... so you don't know which weapon you will get.

    AND spawning a weapon on the player makes the player collide with that weapon, which then causes that weapon to be destroyed and another random one created.

    the reason why it looks like both players are getting equipped is that your collision boxes on the weapons are a lot bigger than the actual image, so when you are moving the players, they are both colliding with a weapon, and then both running the endless loop of destroying and creating a new random weapon.

    So, what you probably want to do is add an instance variable to the weapon family called "Equipped" and set it to false. Then when a player collides, pin it to the player and set it to equipped so the other player wont pick it up if they cross paths...

    https://www.rieperts.com/games/forum/weapon_test.c3p

  • ReallyBasic

    something like this? I have them fade out so you don't end up with a million instances bogging things down.

    https://www.rieperts.com/games/forum/tanktracks.c3p

  • it should work - probably security settings on your phone...

  • koshnaranick

    there are a couple ways... first way, click on Layout 1 in the Project window on the right, then click on "View" by Project Properties over on the left side of the screen... look under Display, and change Viewport Size (default is 640x480)... make it 800x600 or whatever you want.

    another way is add an action to event 1 "On Start of Layout"

    add System - Set Layout scale to 0.5

    that will zoom the camera out to 50%

  • Fengist

    I know that when I use "Browser - On Resize" I have to add "Wait 0.2 Seconds" before I update all the elements on the screen, because it seems to take some time before the viewport settings finish getting the new screen values.

  • You do not have permission to view this post

  • CheeseLife

    you could keep all that data in an array, and then it is a single structure to save and load from local storage.

    that would also let you expand the data stored - you could keep the top 10 best scores for each game type, save the date, user name. etc... and still only need one get and set.

    EDIT: also, you don't need to check if key exists and then get it. checking returns the value stored if it does exist.

    EDIT2: it also looks like you are checking local storage every single tick - 60 times a second. you really only need to read local storage at the start, and then save at then end of a game if the score is greater than then last high score. (although I can't tell for sure how your code is structured based on that image)

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-Year Club
  • 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
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies