hdnine's Forum Posts

  • Hey everyone,

    This is probably one of those easy things i just can't seem to get right but i have my level set up with solid walls and objects. As i move the player she hits them just fine and stop in her track. Now I've added enemies for the first time and they just pass through all solid objects while moving toward the player.

    I can't figure out what's wrong since they are essentially the same as the player object except for the ScrollTo and 8-directional behavior? Both have collision enabled so what am I missing?

    Any help would be appreciated, thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok thanks ppl ^^

  • Hey everyone,

    I've been working on a smaller project which will require collision detection. Now, as i usually try and do it is to have a black/white map where black i solid/collide and white is non-collide. After reading quite a bit on the matter it seems that this isn't possible in C2 but that i rather have to create smaller segments of sprites and make them solid? I wanted to get this confirmed since i would prefer the other way around.

    My other question has to do with connecting an Xbox controller to C2 and Chrome. I've come so far as to being able to control my character in four directions but i really wish to have him move in eight. Is there built in behaviors for this or do i need to "write" my own code? It would really help if something like that already existed since they have friction, correct delta time based movement and other things working.

    Cheers!

  • Ok thanks

  • Hey everyone,

    I've been playing around with my Android phone for two days to see how things work. Right now i have my game set as Fullscreen in browser: Scale outer which seems to works. The noticeable problem is that the graphics, which look okay on my desktop, are way to small on my Android and this is where my question comes in.

    I see two ways to go about this:

    1. Either i scale the whole layout to which ever size looks good, let's say 2.0 (twice as large). This however makes most of the layout disappear due to the limited window size so the graphics scale out of screen if you will.

    2. I scale every individual graphical element but then they have a much smaller layout to work on since the window size is the same but the objects are twice as big. I can imagine that this approach could make it hard to plan your game levels and stuff like that since they look much smaller on my desktop?

    So anyway, I was hoping on some input about best practices when it comes to mobile phones. I guess i want the game to look and act the same on both devices since they use the same aspect ratio, but only with larger graphics on the Android. Or is it so simple that you need to create two versions every time, one for desktop and one for mobile?

    Thanks!

  • Superb thanks! ^^

  • Ya ok... yeah sorry, i already new about the Touch "act as mouse" type of setting. The thing is that i want to scale the graphics on mobile devices and since my Galaxy S4 and PC have the same resolution, i need some other way to tell them apart. Is there like a "is desktop" or "is smartphone" check?

  • I've come across a small problem where i have a start screen that sets a variable to either "mouse" or "touch" depending on which interaction has been done. This works fine and the main screen loads.

    The issue for me is that i'm not sure of which is the best approach when trying to resolve the input method? In my code i try to use both according to the top part of this image:

    <img src="http://i.imgur.com/rGwprLv.png" border="0" />

    The code above is the way i tried first, that is if the mouse is over OR touch i touching. However, they seem to conflict and only the touch works. So underneath it you see the approach that did work but since i am using one event sheet for my whole game, there is a risk that i will have to put it a lot of input checks.

    My question is if there is a better way, perhaps somehow to utilize a function for these repeating checks?

  • Superb! I actually never got that part. I strangely enough read it but it never occurred to me that user input is needed.

    Now I simply added a button which triggered the request and voila! Thanks! ^^

  • I have been reading about this for the last hour now and no matter what i try i can't get the Browser-object's "Request fullscreen" to trigger. At first i thought it might be other things in my project code that prevented this from working, so i tried a blank document with only this object present.

    <img src="http://i.imgur.com/5OQP5DD.png" border="0" />

    Clearly I must be doing something wrong because I've tried it on my PC with both Firefox and Chrome and on my Galaxy S4 with Chrome, all latest versions... <img src="smileys/smiley7.gif" border="0" align="middle" />

    Now I've seen pages before that do request fullscreen so i know it works in my browser. I also performs just fine if i press F11. Any help would be appreciated. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I finally found out what the problem was. My function for calculating the nearest object was just fine. The issue was in the fact that, when setting the current target, i only did this at one time and never kept updating the "currentTarget" X and Y positions.

    Because of this, nearest target was only calculated on time. Thanks for anyone reading this post! ^^

  • I have an issue which i can seem to solve. The function that i am using is to calculate which of all module-objects are closest to the current target you are dragging.

    To test it i have tried different debug texts and i even set the nearest target opacity to 50. The crazy thing is that the function seems to work... but only one time and this is what i can't figure out. While I'm dragging, why doesn't the nearest target update? It only does it one time when i start the drag event.

    It's probably something simple but I've been staring at this code since yesterday and i can't find what's wrong. <img src="smileys/smiley26.gif" border="0" align="middle" />

    <img src="http://i.imgur.com/OovpzwD.png" border="0" />

    The code enters the function over and over but the nearest target seems to only be set once. Anyways, any help would be awesome.

  • the Dragdrop enabled just mean that drag and drop is now possible for that module. Not that you will start dragging it.

    You will probably have to make your own drag and drop, but it is not that hard.

    just set module.x to mouse.x and module.y to mouse.y while dragging.

    Right as i suspected... thanks <img src="smileys/smiley36.gif" border="0" align="middle" />

  • Regarding posting links you need a certain rep-rating for them to work. So new or inactive members to the forum can't post links. Have the same issue. ^^

  • I find myself trying to find a solution to perhaps an obvious problem? I have some code that enabled drag&drop after pressing the mouse down on an object for 0.5 sec. I've verified that it works since both a test scaling of the object works, as well as checking for the "Is enabled" condition.

    The problem is that the drag event doesn't take effect until i release the button and click & drag again. I need it to start following the mouse immediately so is there anyway for the built in behavior to work or do i need to write custom code?

    This is the current setup:

    <img src="http://i.imgur.com/QdZ3CKf.png" border="0" />

    On a side note this forum seems to have an issue with me taking too long time to write my topics since it gives me an error every time that my session time is up. >.<