TRMG's Forum Posts

  • You could spawn them invisible (or in an invisible layer)

    That wouldn't really work, as I need them for physics...

    Regarding the hex grid. I'll check a bubble shooter I have implemented that is built on an hex grid and adapt it. But I don't think I'll have it today...

    That would be awesome, thank you!

  • brunopalermo Thank you, it worked great!

    I got one problem with it tho, it seems not to spawn them all at the same time. Is there a way to make the game wait till it finished spawning them in?

    To stop the infinite loop problem, I think I'll check to see how many seconds went by since the start of the game and if and there have been like 3 seconds, I'll just stop the spawning. (Unless I'm wrong about this. This is my first randomly generated game, if you couldn't tell =D)

    Also, if it isn't to much to ask, could you show me an example of the hex grid?

  • Hey !

    Be aware that doing this by only checking random coordinates can be very long if the map is full or nearly full of bases. You can even make an infinite loop here.

    That being said, the problem in the events is that you take 1 set of random coordinates per cycle of the main loop. So in total, you take maximum NrOfBases coordinates, even if one random set is valid or not.

    The second problem is that, if it find any base that is further enough, then it decides that it is a valid position. Instead, it should be only if ALL bases are further enough.

    So you need to change the base loop here, by making it a while instead of a for, and by modifying you "validation" detection. The easiest should be to do something like this :

    EDIT ! I forgot the While in the main loop....

    Hi, sorry for responding so late...

    I tried your code (the one with the while loop), but the bases still spawn within that minimum distance...

    I then tried with MinDistance being less than "distance(Base.X, Base.Y, X, Y)", but that didn't load...

  • Hey guys, I want to add some elements of randomness to a small game I've been working on.

    I have a number of sprites that I want to spawn randomly, but I want them to be at least 1300px away from each other.

    I have tried this code...

    ...but the sprites still overlap:

    Got any suggestions?

  • You can use a dot product to get that:

    cos(angle)*sprite.physics.velocityX + sin(angle)*sprite.physics.velocityY

    Awesome, thank you very much!

  • Hey there, I want to check if a physics object's velocity at an angle is greater than X, but in C2 I only found the option to do this only on the X or Y axis...

    I know there must be some way of finding it out by using the separate X and Y velocities and applying some mathematical equation, but math was never my strong point =D

  • I used Phonegap but I kinda didn´t like it because of some error.

    I then switched to Intel XDK that solved that error, but as you mentioned it will be shut down.

    In the end I took a day to work into Cordova CLI and I´m done with build services (unless the C3 ones are good, since it would be a first-party build service)

    The main problem I see with build services is the fact that they end up using Cordova anyway, but add another instance (their whole service and programs) that can cause errors, not to mention you either have to work around them or are at their mercy to fix them. In my case Intel said they cannot fix it because it would cause a security issue on their end and they just didn´t want to. <img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes">

    I also heard good things about Cocoon, but right now I don´t see a reason to switch.

    That's interesting. Do you know a tutorial about how to use Cordova CLI?

    I've tried using the first one on google (https://youtu.be/Abn7EAK8sBY) but it seemed awfully complex, especially compared to phonegap or XDK...

  • Why would you switch?

    To me it seems exactly like C2, but only usable with an internet connection...

    The only features that I liked were the phone editor and the live preview in the editor (since I found it really useful while using Unity), but neither of which are worth $99/year...

  • Since Intel XDK will be shutdown at the end of June, I was curious to see what other options are there and what programs people use instead of it.

    So, what platforms do you guys use to build mobile apps?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • faulknermano

    No I got that, just thought it was a bit weird that the first cube wasn't cube 0...

    99Instances2Go

    That's an interesting way of looking at arrays, thanks for sharing!

  • It's working as intended. When you set the size you need to at least use 1 for each of the dimensions. If it helps the number of values in the array can be calculated with width*height*depth, so if any are 0 then no values can be stored.

    I see... Thanks for the explication!

  • So I've been recently experimenting with arrays and I found that after setting a size limit on the array, they simply stopped working.

    After toying with it a bit, I found out why:

    I basically use arrays as multiple variables (Like instead of having 2 variables for each sprite's coordinates, I would use an array) and I would only use the width of the array, so when I set the size of the array I thought: "I'll use 10 positions on the width and I can set the height and depth to 0 since I won't use them"

    But after I made that change, the array would not work. Later on after I tried setting the height and depth to 1, It started working again.

    So my question is, if the arrays are 0-based, why do I need to set it's value to at least 1?

    Is this a bug, or am I missing something?

    P.S. I'm sorry for any spelling mistakes, I wrote this on a pc with no spell checking =D

  • [...]It was a good program but at this cost there is no way I can justify it.

    It's like they're trying to be the Activision of game engines.

  • Thanks for the Reply! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Well, i figured some invent system out, but your sounds better. <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Heres the project, take a look, show me how youd do your stuff <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    Anybody is invited to drop some knowledge. :3

    https://www.dropbox.com/s/50aeq17wmq1ao ... .capx?dl=0

    Cheers!

    Seems like you can't post links yet...

    You can change the url to something like "www [dot] dropbox [dot] com/etcetc" and then it'll work.

  • Set elasticity to zero. More damping. And a density to like 6 or so (so they are weight more compared to your object).

    Thank you!