Vaank's Forum Posts

  • oooook! thats good! just what I was looking for! thanks a lot!

    i'm newbie and im doing my best to understand loops but this is too much for my little brain for the moment

    I'll take a look at your tutorial, one of the few I have not read yet

    Lumik, I was wondering the same, I will definitely use just random without int

    Thanks again

  • So try to play with sine behaviour, it gives you a lot of possibilities

  • That dependd on what you are trying to achieve. You can do this by using Sine behaviour or by moving "manually" with

    I dont know if thats the movement you want, but can be improved a lot, give sine behaviour a try

  • If you just randomly pick array.x and y locations, you would be picking non empty locations and occasionally be picking the same empty location, so it isn't going to be more efficient - unless your array is huge and you want relatively few enemies.

    I understand, perfectly explained, thanks!

    The first method gives you the potential to set up your array to adjust the possibility for creating enemies in certain areas - you could use a range of numbers to influence where the enemies are: 0 means location is filled, 1 means empty but no chance of enemy, 2 = small chance, 3 = medium chance, 4 = high chance. You could also use different number ranges to indicate what types of enemies can be created in various areas...

    About this method, I dont quite understand how to do it, I mean... Do I create a new array with new numbers at locations where "1" in the first array were? Do I use the same event I showed first and restrict it to arrays.coordinates? Or what?

    (I think im not doing what you suggested at the top, maybe yes and Im idiot)

    Thanks a lot

  • or this, but gives you less control (I can attach map screeshots of the end result if you want)

  • I dont know if thats what you mean, but this worked, but im not happy with it, didnt like the method

    I thought I could just pick random array.x and array.y with certain values

    Thanks a lot

  • I have a procedurally generated map done with an array, 0=filled tile, 1=empty tile

    Now I want to generate enemies (yes again enemies) in the empty tiles, wich are the floor

    I tried lots of things but cant figure out how to do it

    I know how to spawn enemies in every empty tile, filling the hole map, but I just want to create at random locations and a certain number of them

    The non-proffesional way to do it is creating N sprites and re-positioning them until they are not overlaping the tilemap, but i want the first solution

    I wonder it's by choosing random cells from the array and creating there the sprites, but dont know how

    Thanks again!

  • Even with the new release you can use the deprecated webstorage (not recomended) right clicking on the insert new object window

  • Link in the Google Play page description

  • Cant be done with jump-thru?

  • OOOOOOOOHHH! wow, now I see! that's exactly what I wanted! I feel so dumb right now, thank you very much for your patience!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes I know, im just saying that it could be easy if you create a family.maxhealth variable but then apply a diff number for each sprite as you want (sprite1.maxhealth=10, sprite2.maxhealt=20, etc), so when you create the new sprite it is created with his own number, with no need to create a new event to change this number

    I dont know if im explaining myself correctly as my english is still bad ^^'

  • ok, thats not what I really wanted but this is much easier than manually create an instance variable for each enemy

    If linking a sprite instance variable from a family to his family instance variable could be done, it would be awesome (for sure there is a plugin out there)

    Thanks a lot for your replies! Made my day RamPackWobble! I can conclude this as solved

  • Thats not what I mean, I need to have a different predefined MaxHealth on each type of enemy

    Enemy1.maxhealth=50

    Enemy2.maxhealth=100

    and so on

    So when a bullet hits on the family enemies it substract X from the health from the on-collision-with sprite

    The point is just to have 1 condition that affects all enemies but each one with different max health

    I know every enemy has his own health if I make a family instance variable, but the same max health too, I want different max health for each enemy

    I hope its clear now ^^'

    PD: sorry, my fault, I should have mentioned its maxhealth instead of health

  • I dont know if im misunderstanding something but... the actual problem is that every enemy inside the family has a different number for health, so i cant refer to the family instance variable since, if i had one, it would be the same for every object inside the group

    If I create a family instance variable, for example enemies.health, this aplies to all instances, enemy.health, enemy2.health, etc So if i want to substract 10 from the enemy health i want this enemy to have enemy.health=50, and enemy2 to have 100 health, for example

    I dont know if I'm correctly explaining my problem