Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Arakair

Pages: 1
1
Ask a Question / Re: Ballistics / Curves
« on: June 19, 2012, 07:26:10 am »
Ah, ofcourse, i should have been able figured that out myself haha! Thanks alot for clearing it out!

Code: [Select]
atan2[([y of enemy] - [absolute value of ([x of self] - [x of enemy]) - [y of self]) ([x of enemy] - [x of enemy])]
meaning - it takes distance in x and distance in y and decrement y by the absolute value of distance in x.

This may indeed need more time to calculate. How do you calculate bullets motion currently (I mean without the curve)?

I tested it out, and it works like a charm! Cheers!

Would it be possible to alter the initial angle to be higher, say, -90 degrees (straight up?). I played around with the numbers a bit, but cant seem to solve it.

My old calculation was basically the same (without the curving ofcourse), setting the velocity between the two points using atan2. I guess its somewhat heavy to calculate every frame, but i cant find a more lightweight approach.

Thanks again! You saved me from the headaches! :)

2
Ask a Question / Re: Ballistics / Curves
« on: June 18, 2012, 04:07:02 pm »
Ive been experimented a bit, so far i managed to get a nice looking downwards curve, its not hitting the target tho!

In the update event for bullet, set it's velocity towards [x of enemy], and ([y of enemy] - [absolute value of ([x of self] - [x of enemy])].
I dont think i understand this "and" correctly, there is only one field in the "set velocity" block, and when using 2 blocks only the last one runs. Im probably just too tired, ill sleep on it and try again first thing tomorrow! :)

Cheers again guys!

3
Ask a Question / Re: Ballistics / Curves
« on: June 18, 2012, 10:12:54 am »
Thanks for the input! Not quite what im after tho!

Making a point C is probably a good idea, and then curve the movement with those points, i still have no clue how to do the actual curve tho.. :)

I drew a quick picture in paint to clear up any misunderstandings! :) .. Trying to do a curve like the second illustration, arcing the bullet from point A to B, instead of it going in a straight boring line!

Cheers!

4
Ask a Question / Ballistics / Curves
« on: June 18, 2012, 06:59:35 am »
Hi!

Im putting together the finishing touches on my first project in Stencyl, and ive run into a problem ive been avoiding for a few weeks now. The game is your basic tower defence type of game, where towers shoot projectiles from point A to point B. As this looks very stale, and im trying to add a nice curve between the two points. However, being terrible at math i cant seem to figure it out!

I guess the easiest way would be to just animate the projectile itself, so it looks like theres a curve when there is none, but i would rather do it the "right" way.. :)

Any ideas or pointers how i could solve this?

Cheers!

5
Ask a Question / Re: When game paused, behavior is still working.
« on: April 25, 2012, 02:26:50 pm »
Ah yes i tested it out in my game, i could dodge every timed event by pausing/unpausing..

Luckily i found out about the pauseAll() and disabling the flixel pause overlay, not sure if that will work in iOS tho.. :)

6
Ask a Question / Re: When game paused, behavior is still working.
« on: April 25, 2012, 11:22:34 am »
Borrowing the topic a bit, hope you dont mind..

Doesnt the "game is paused" block leave room for cheating events? I mean, what if you trigger an event after 10 seconds, pause the game 9 seconds in and unpause at 11 secs? You would technically skip the event, right?

7
Ask a Question / Slow Motion
« on: April 25, 2012, 01:36:38 am »
Hi!

Im trying to figure out how to make a proper slow motion effect without having to recode my entire game.. Ive been searching for quite some time now but cant seem to find the right way.

I read some posts about changing the timescale in FlxG, which works, but sadly makes input very dodgy and way too unreliable.

Another post suggested playing around with box2ds time step, i dont seem to be able to work that one out tho..

Any other ideas how to create slow motion? Or anyone able to help me out with the time step thing?


Cheers!

8
Ask a Question / Re: Drawing text on top
« on: April 05, 2012, 05:00:54 pm »
Not having much luck figuring this out. Seems like the lag was coming from me messing up the function calls, console was spitting out errors.. This is very strange tho - the error makes the text draw after the image, as intended. Actually, any error will make the text draw after the image..  ???

Whats the proper way to call an actors "draw" function?

9
I had the same problem in my last project.. Id suggest you just use create instead, recycle is pretty dodgy.. :)

If you are worried about fps drops, you can always disable the standard collision for your bullets/coins and write your own.. Abigayl made a great tutorial about it few days ago!
http://www.kongregate.com/games/Abigayl/stencyl-2-0-advanced-tutorial-lagless-actors

10
Ask a Question / Re: Drawing text on top
« on: April 04, 2012, 02:41:00 pm »
Justin; not a bad idea! i gave it a try but got pretty heavy fps drops, no idea why draw is so heavy, im not printing that much text.. Ill try giving it a few tweaks and retry! Thanks!

Sunflower; since i keep updating the draw order for my actors during runtime, drawing on scene behaviors doesnt seem to be doing any diffrence :( ..

Any ideas why drawLayer was removed from 2.0?

11
Ask a Question / Drawing text on top
« on: April 04, 2012, 05:36:57 am »
Im having trouble with text appearing under my actors, on both actor and scene level behaviors. Im using a slightly modified version of Gregs layer manager, that draws my actors based on layer and position. I guess i need to draw my text after the actors gets drawn, but cant figure out how..

I did some searching on the forum, and it seems like drawLayer might be what im looking for, however, the function doesnt seem to exist in 2.0.

Anyone got any ideas how to draw text on top of everything else?


Cheers


Edit:
I guess i could draw all my text in the layer manager loop, using alot of if cases.. Would be pretty messy tho, so if anyone got a smater idea please let me know! :)

12
Ask a Question / Re: UI / Layer Manager
« on: March 03, 2012, 01:40:14 pm »
Aye using the actual drawing block gives the weird glitch, creating actors etc works just fine.

Ahh! Thanks! That worked like a charm! Wasnt aware that it was possible to switch between spaces like that, i will look through the blocks more carefully next time.. :)

Thanks again! Greatly appreciated!

13
Ask a Question / UI / Layer Manager
« on: March 03, 2012, 12:35:21 pm »
Hi!

Im trying to make a UI for my game, but using the Layer Manager behavior it seems impossible to draw objects to the scene level.

Without the layer manager, i could just draw the objects to, say, x 10 y 10, and it would show up on that position on screen no matter where the camera was on the actual stage. However, when i try to do the same with the layer manager attached to the scene, the objects i try to draw end up on the actor with the highest Y value.

Ive looked through the code but cant figure out whats going on.. Any ideas how to sort this?

Cheers!

Pages: 1