lionz's Forum Posts

  • You can use for each element for each X as an option, or you can use a system for loop from 0 to n where the data 'loopindex' can be the current X or the current Y. So if you have 5 rows and run for 0 to array.width, it will run 5 times and each time you have the loopindex of 0,1,2,3,4 to refer to each row.

    I would definitely take the item references from a global variable as there's really no need. You can use global var for the amount like numWood numStone collected for the player. The way you will design the crafting events is kind of based on how it works in the game, you can just throw any items into a place and hope it makes something seems a little wild for the player.

    Maybe for the crafting it's easier in the end to use a sprite with instance variables which are named by item name and the value is the number dropped in. It really depends how this crafting would work, I can't imagine it as a player.

  • There's a lot going on here, I'm not sure how the ingredients are listed, i thought you said its crafting from 2 item types. Also I wouldn't use IDs for items theres no need, should be strings for the item names and numbers for the amount required. In general you move through the array by using the array object and for each X to check each recipe, but within this you need to check certain Y (columns) to see if it's matching.

  • Fill out an array file, under Files. Use AJAX to request the file. On AJAX completed, load lfrom JSON ajax.lastdata.

  • Each recipe is a row of one array, like a spreadsheet. When you craft, this is a separate array to compare back to the recipe one.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So there is an array object, and you can load the array files in or sure import as JSON too. The idea is the recipes are listed in the array in whatever format you want so something like :

    item 1 | amount 1 | item 2 | amount 2 | makes what

    Then the crafting area relates to a separate array with the same structure, as you drop in items into slot 1, the item 1 and amount 1 updates, as you drop items into slot 2, the item 2 and amount 2 update.

    When you click on 'craft', you compare this array with the recipe array to see if anything matches.

    So if you drop in 2 wood and 2 stone, it would then look in the recipe array for

    wood | 2 | stone | 2

    and then this makes the item at column 5

    Something like this would be my approach

  • Create an array of recipes and compare against them when you try and craft. Recipe would contain 2 items and the amount required so can look something like 2 | Wood | 4 | Stone, then when you drop the items in you compare to a craft array which has the current items and amounts dropped in, in a similar structure. I think global variables are only useful for total item amounts that you would display in a HUD UI.

  • Should be, dunno how you broke it

  • I mean use the event 'player on collision with tilemap'

  • Player on collision with tilemap?

  • They should continue moving unaffected if you didn't change anything. Another possible issue is if that event is running constantly from the top.

  • Ah ok, on the frames strip at the bottom, right click import frames from strip. After you select the image it will ask you.

  • When you import the spritesheet using the image editor it asks how many images are in the rows and columns and it'll chop it up

  • I already mentioned above, remove the angle actions you've added if the bullet is going at the same direction

  • If it continues at its current angle of motion then I see no reason to change the angle or add actions for angle when you set the special bullet?

  • The logic where you assign unkillable variable is just a bit wonky. You're saying compare for each bullet if its own IID is equal to an IID in a random range, this could be true any number of times or never. You should instead set a local variable to floor(random(0,8)) and then set the bullet whose IID matches that number.