hdnine's Recent Forum Activity

  • I hate that I'm so lousy at math and this is something i struggle with all the time. In my game i wanted to calculate how much the opacity for my bullet object has to decrease per tick, starting from 100% and going down to zero over a distance of 100 pixels.

    Right now i know the following:

    Bullet speed: 150 pixels/sec

    Travel distance: 100 pixels

    Current opacity: 100%

    Delta time (dt)

    As i understand it, i need to calculate the speed the bullet takes to travel over the set distance which should be time = distance/speed. So 100/150 = 0.66 pixels/sec right?

    But this is only how far it moves each second, so to calculate the distance each tick (to get frame based animation) you probably have to do 0.66 * dt? This gives me approx 0.0106 pixels/tick...

    This is where it gets confusing and I'm sure that i've approached the whole thing wrong up until now... but how do i know how much the opacity should decrease each tick? <img src="smileys/smiley5.gif" border="0" align="middle" />

  • Hey everyone!

    I've been trying to make my enemies bounce while moving forward towards the player. This means moving in both X and Y directions and please note that this is NOT a platform game so there aren't any solid platforms to stand on. It's more of a top-down game and below is my current code:

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

    At the moment I can see this working in one out of two ways:

    1.) I use gravity and make the enemy jump up. The problem is that the bounce needs to be stopped where it started (in Y axis) and this is the way i have it now -- a nice bounce in place effect. The problem is that the enemy can't move in the Y axis towards the enemy because this interferes with the bounce. Also the gravity messes things up.

    2.) I make an animation that looks like a bounce and then move the enemy towards the player by calculating distance and the amount to move each frame. While doing this i just run the animation over and over. The problem with this is that the animation only can change one pixel per step so it becomes very jerky.

    I would prefer to have it bounce "naturally" by utilizing gravity since i believe this would look smoother, but since there are no platforms or solids to bounce on, this has presented a problem for me. Any suggestions would be awesome!

  • Ok thanks ^^

  • 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!

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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! ^^

hdnine's avatar

hdnine

Member since 10 Jul, 2013

None one is following hdnine yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies