Citnarf's Forum Posts

  • Basically what I'm trying to do is get a sprite to tilt left or right, depending on which key is pressed, but i would like this to happen in a smooth motion, so i figured lerp would work, which it does, but only for one direction.

    In the cap below, you can see that when the right key is pressed it rotates clockwise to a 45 degree angle, however when the left key is pressed it still rotates clockwise to get to 315 degrees.

    http://dl.dropbox.com/u/6660860/lerp.cap

  • If you want to just write a website from scratch, i suggest using Notepad++, its what i use, and it supports many languages (including HTML and CSS).

    http://notepad-plus-plus.org/

  • Basically what i think is happening is that if you move your mouse over them fast enough, the cursor can hit more than one of them in a single tick, so then on the next tick, it checks to see if your mouse is over "Sprite" which is true, so the else condition doesn't get called, hence why they stay highlighted.

    So lets say i quickly move my cursor from the first sprite to the second in a single tick, then on the next tick it says 'Is mouse over sprite?" which will come out as true, since my mouse is on the second sprite, so it won't call the else condition.

    I hope that makes sense, but its just a wild guess and I'm most likely completely wrong

    Edit to answer your edit: As far as i know, your not meant to make else events sub events, an else event will always attach itself to the condition directly above it.

  • How about this? http://dl.dropbox.com/u/6660860/select.cap

    Note: The order of events is important here, the mouse over event must come after the Always event.

  • 1. It seems as though the timer delay is causing this, I'm not sure if its a bug or not as i have never really used the timer before, but you should be able to overcome it by making an event like: Is gradient.width greater than 200? -> Set width to 200.

    Also, while your method seems to work just fine, personally i would use a private variable for "dash" instead of relying on the width of the gradient bar. Then you can set the width of the dash bar to (c/m)*w where c = Your current amount of dash, m = your maximum amount of dash and w = the maximum width of your dash bar when your dash is full. So it would look like: Always -> Gradient Set Width to: (Player('Dash')/200)*200. Then you would just need to adjust the value of dash and the bar will change width accordingly. But if you like your method, go for it , i just find variables slightly easier to work with.

    2. Can't really see what you mean here, seems to work fine

    3. As far as i know, this is a bug.

    4. Do you have the "Snap to Moving" and "Snap to Resizing" boxes checked? Also i noticed some of your Grass objects only had a height of 30 instead of 32, this can cause them to snap funny.

    Also, welcome to the forums!

  • The problem is with your bullet sprite, the hotspot isn't set correctly. Open your bullet sprite and select the hotspot tool and press 5 on your numpad to center it .

  • You can go with the random() option, but the most common ( at least that I've seen in games ), is doing like most humans do, target the closest one.

    To do this you could use pythagoras ( a^2 * b^2 = c^2 ), where a = object.X - target.X and b = object.Y - target.Y, do this to find the distance between all the targets ( on screen or whatever ) and check for which distance is the shortest. If some distances are equal, just take the first one or run the test again, considering the chances that something has moved.

    There might be a better way, but this idea popped into my head. Can't really consider it much though, as I am in class.

    You can do that a bit easier with the Distance(x1,y1,x2,y2) expression.

  • Awesome list! Thanks

    Mods should sticky this ASAP

  • Woah i thought it would be something simple, but not THAT simple

  • This is indeed VERY strange. I got a different error to you:<img src="http://dl.dropbox.com/u/6660860/error.png">

    As you can see my error points to object_player_arms, at event 0 on the AI event sheet. So maybe the issue lies somewhere in the event sheet itself and not with a specific object? There isn't even an "Event 0" .

    Sorry i can't really help more than that, this one has me stumped, but maybe it will guide you in the right direction on where to look for the problem .

    Edit:

    I decided to test it some more and disabled the AI event sheet, and got this error:<img src="http://dl.dropbox.com/u/6660860/error2.png">

    So maybe its not the AI event sheet at all. I also tried toggling different events on and off in all sorts of different combinations and NOTHING seems fix it .

    I'm sure it will turn out to be something simple though

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hopefully this is what you were after, you can change the global variable "SpawnDistance" as needed, it currently spawns the enemies 128 pixels away, or you could even randomize the spawn distance the same way i randomized the spawn angle.

    Note: I saved this in 0.99.96, and it said you saved it in an older version, so you may need to upgrade to open it.

    http://dl.dropbox.com/u/6660860/spawns.cap

  • Out of exactly 20 runs i got 0 winners.

  • Not bad for Australia... i guess...

  • I use Paint.NET.

    Me too .

  • This sounds great! Going to try it now .