Draimond's Recent Forum Activity

  • Lets say I have 15 instances of Sprite.

    Sprite has an instance variable called "true".

    The value for true will be either "0" or "1".

    The user controls position of Sprite.

    Sprite.true will depend on it's location defined by the user.

    I need to know how to: Count each Sprite where Sprite.Ture = "1" Every Tick.

    I thought it would be something like:

    { For Each "Sprite", Sprite.True = "1" [ Add 1 to Global_Variable(Count) ] }

    This works as a once off count, but obviously not in real time.

    Any thoughts?

  • I hear ya, I'm trying to do the same thing. I want to store and load json data but the only option i can see is to download and that just sticks it in my download directory. i cant even get the dictionary or array json load to work, even from within the imported files list.... and the manual and tutorials don't detail how to do these things, they just say that you can... !?

  • Thats why i'm here, I can't find a solution that will allow construct to do this, because construct is whats going to have to send the header wrapped in it's ajax GET request. Realistically I need to have construct send its AJAX GET request with an Authorization key and instruction for the browser to access "cross domain".

    At this stage I'm leaning towards trying to use the XML plug-in instead as I'm assuming you can write your own AJAX GET request will all the information required.

    However I can't see a way to import a JSON file and then populate and array using the imported JSON file data. This is paramount because there are over 100 elements each containing over 30 properties. I am not about to embark on manually populating my array with over 3000 entries which are subject to change at any time.

    The website I've been authorized to pull the data from keeps their database up to date and complete. Using their JSON file is the only way I can build my app and export it to android in a timely and viable manner.

  • I'm trying to pull a large database as a JSON file from a website using the AJAX plug-in.

    I've copied the text bellow from the Construct 2 AJAX Plug-in Reference page in the manual.

    Making AJAX requests cross-domain or in preview:

    "If you want AJAX requests to your server to work from any domain, or in preview, you can configure it to send the following HTTP header:

    Access-Control-Allow-Origin: *"

    The manual fails to mention how this is executed.

    Exactly how do I configure an AJAX request to send a HTTP header such as "Access-Control-Allow-Origin"

  • Still not sure why I was getting more kills then Spawns, but I moved the "check if enemy has no hp" to every tick, and its now working as intended

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah i like that concept. Not what im looking for here, but I'd like to implement that somewhere.

    Yeah so, pick top worked for the double kills but im still getting more kills then I should be able to...

    Just ran the layout a few times, 4 times it worked as it should but on one occasion it spawned 29 enemies but somehow i got 30 kills

  • True, ty, Ill give that a shot.

  • Having an issue in an arrow defense game where my bullet collides with two enemy's who's hitboxes are overlapping on their leading side, causing both to be destroyed by a single bullet but only be counted as one.

    Here's what my code looks like:

    Bullet on collision with Enemy - Destroy Bullet, & Subtract Bullet.Damage from Enemy HP

    & if HP </= 0 - Destroy Enemy, & Subtract 1 from Number_of_Enemies, & add 1 to Score

    Game Completes when Waves = #, & Number_of_Enemies = 0

    My Testing Information is showing more Enemies are being destroyed then whats being created.

    Edit: Actually now that i put it in writing and think about it i have no idea whats going on.. but like i said, i got more kills then enemies.

Draimond's avatar

Draimond

Member since 19 Mar, 2014

None one is following Draimond yet!

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies