Joao Daniel 2022's Recent Forum Activity

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Local variables are reset each loop, so once you are done with your event that data is lost.

    The object has instance variables, these will be wiped as soon as the object is destroyed.

    Global variables can withstand this - but they are not designed to hold an objects stats since you can have many objects all looking for different values at the same time.

    Here is how I worked with destroying enemies in my last project.

    Enemies have a variable Boolean I set when they are killed and then I destroy them.

    In a new condition if an enemy is destroyed and also has killed true (This eliminates 2 swords killing the same enemy during the same tick) I can call my loot function while still having that enemies position and name stored. I then pass these into a function so I can use them after my enemy loses that information lose the information.

    (Mine is done with Families - but it should hold true with multiple of a single enemy as well)

    Thanks for your support and patience ^_^

  • hi guys, i have a doubt about firebase i'm recently creating a game and the data will be saved in array, json and i would like to know if it's possible to send and receive this data in firebase database, since i can't at the moment pay a private server to save and receive this data

  • Ya call of that info before you destroy the other object.

    Or call a function and send in all the details you need as parameters before you kill the object. Every time I do this it just ends up being messy though.

    I created local variables to receive the variables of the enemies that were destroyed so that when using "OnCreate" nothing seems to work

  • Do you need to destroy it? How does the game work? You may be able to hide it and make it appear again.

    I put an option to drop items on enemies and also to create other enemies in place as soon as the previous one dies, so I need the new enemy that will be created in the same place as the other to copy the same variables of the previous enemy in real time, because enemies of the same type can have different variables and I want the new one that will be created in the same place to copy only the variables of the other enemy that was destroyed

  • Hi guys, I would like to know how I can get the same variables from an object that was destroyed and created another one in real time.

    it works like this I have several objects on the screen with different variables from each other and when the object is destroyed another one equal is created in place and it is necessary for it to be created in place so that it gets the same variables of the destroyed object in real time, the part to create the same object I already learned with a string variable and in it I put the name of the object that will be created in its place as soon as the object is destroyed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • howtoconstructdemos.com/roller-paint-demo

    Thank you very much

  • You should do something like this:

    > Variable isEmpty=1
    
    for "y" to 0 a floor(TileMap.Height÷16)-1 
    for "x" to 0 a floor(TileMap.width÷16)-1 
    TileMap: tile (loopindex("x"), loopindex("y")) >=0 
    ..... Set isEmpty to 0
    ..... Stop Loop
    ..... Stop Loop
    
    
    Compare variable isEmpty=1 
    ...... Tilemap destroy
    
    
    

    Sorry it still doesn't work, when I click on a tile to delete it the tilemap is destroyed completely, please when you have some time could you make a cp3

    + touch: to click TileMap
    -> TileMap: arease tile (TileMap.PosTileX(touch.X), TileMap.PosTileY(touch.Y))
    + System: for "y" to 0 a floor(TileMap.height÷16)-1
    + System: for "x" to 0 a floor(TileMap.width÷16)-1
    + System: TileMap.TileAt(loopindex("x"),loopindex("y")) = 0
    ----+ System: isEmpty = 1
    -----> TileMap: destroy
    
  • Hi! I just tried to add google play to my game project but the website looks totally different and asks different things I don't know how to answer. I need to create a oauth screen, oauth login credentials etc.

    How do I set this up to work with Construct 3?

    Any help would be very much appreciated.

    you just need to watch some youtube videos about it and you will learn fast, i also had difficulties with this at first

  • Hi guys, I have doubts about googleplay, I posted games on GooglePlay but I can't get players no matter how hard I spread the links in gaming communities but in the end I always don't win anything, I would like to know why games on GooglePlay are so difficult to be downloaded I know you need marketing for this but the prices are very expensive, do you know methods to teach me please?

  • Two options:

    1. Loop through all tiles and check if they are empty.

    2. Get Tilemap.TilesJSON of an empty tilemap and save it to a variable. When you need to check if a tilemap is empty, compare its TilesJSON with that string saved in the variable.

    For example, the JSON of an empty tilemap may look like this:

    > {"c2tilemap":true,"width":53,"height":30,"data":"1590x-1"}
    

    But in your case it may be different.

    Hey

    I made the code to detect if the TielMap is empty and then delete the TileMap but for some reason if the TileMap is all complete and missing some tile in some frame then it is destroyed, I need it to detect if the tilemap is completely empty to then destroy it

    This is the code I'm using to detect if the TileMap is completely empty

    + System: for "y" to 0 a floor(TileMap.Height÷16)-1 + System: for "x" to 0 a floor(TileMap.width÷16)-1 + TileMap: tile (loopindex("x"), loopindex("y")) = -1 -> TilesMap: Destroy
    
Joao Daniel 2022's avatar

Joao Daniel 2022

Member since 19 Jul, 2022

Twitter
Joao Daniel 2022 has 1 followers

Trophy Case

  • 2-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

5/44
How to earn trophies