lionz's Forum Posts

  • Haha nice game, well put together.

  • Haha nice game and nice post ^^

  • On the bullet behaviour set 'Set Angle' to No then the angle of the enemy won't change with the bullet direction.

  • You could have the item name in x,0, the amount in x,1 and the weight in x,2, and the combined weight in x,3. Drop in the for loop so it comes out as set value at loopindex,3 to loopindex,1*loopindex,2.

    Now all the total weight you're carrying is in y=4 for every item. You would now just total everything in y=4 as the total weight and compare it to the allowed weight limit.

    Made an example here: https://www.dropbox.com/s/dm0rs5ryi8rtb ... .capx?dl=0

  • You can assign the items from the array to instance variables on the chest, it's up to you how you want to do it. You could fill an array with random items and assign 1,0 to item1 and 2,0 to item 2 on the chest and generate the items again for each chest, or you could do it another way which is to have an array which contains every item in the game and set item1, item2 etc on the chest to a random item from the array. In the end it just depends how your game works and how the items in the chest are determined, but pretty much you are assigning a random item to a variable on the chest.

  • Oh right if it's the same object type in both of those families then it probably won't work correctly, depending on how the game is, but I imagine it won't. You use families to apply the same logic to multiple objects, not for creating 'for a family'. I would return to the isFriendly variable and ignore families altogether for this game and just be careful with the picking.

  • There is a plugin here for building push notifications with cordova :

    This is a plugin for detecting system date/time, you store it on app close and then on app launch compare the time that elapsed :

  • You can create a game that sends push notifications, there are some plugins about. With a timer I'm not sure that's possible as the app does not run in the background. You can compare time elapsed between previous and current launch of the app but that requires you to go back to the app to receive the notification.

  • The instance variable defines whether they are friendly, so you create the object and set its variable as such. Families are used to stop repeating events that apply to all members of a family, as seen in the logic if Friendly is in range of Enemy, which replaces if Friendly Soldier is in range of Enemy, if Friendly Catapult is in range of Enemy etc

  • You'll probably need to use an array for this and I've created a very basic example here which does the following when you press 1 :

    • Generates random item list
    • Assigns the item to a slot linked with slot ID and the array position

    In short the way I make an inventory is to link the ID with the exact co-ord in the array, so slot with ID 1 has item 1,0 in the array, slot with ID 2 has item 2,0 in the array. You can then manipulate and move the data around however you want. Your generation of random items will probably be more complex than "choose" between items, that was just for this example, you could probably make use of number ranges that define item rarity and then item type.

    https://www.dropbox.com/s/6t6mm49g4a4pe ... .capx?dl=0

  • Even though it is in a family you can still pick it as an object so you just create the object type.

  • You don't need to make it so hard for yourself by grouping Enemies and Friendlies into one Family then trying to separate them out. Just reference the enemies in an Enemies family if there are multiple enemy units and Friendlies in their family, otherwise you're going to constantly stumble across weird problems with the picking that need investigation. Your picking here doesn't really reference the Unit correctly, the isFriendly condition is referencing the Unit that is passing the range, so itself, and not the Unity that was just passed. If you have separate families as suggested then you can reference them much easier such as if Friendly X > Enemy then Friendly set anim etc.

  • set text to ""&sprite.V_name

  • It is continually finding paths, you need to take out the 'for each'. I have some experience with this when I tried making a theme park game with pathing guests . It's better to just say if moving object var is this then find a path.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah don't do that. I was talking about creating obstacles to block paths so the player has to go a different way. You said you tried this, but you were walking through the obstacles. It's because the player cannot see them, you need to regenerate the obstacle path at the point of creating the obstacles. The player will then find a new path as the previous ways will be blocked.