Jump to content

Koron XYZ

Member Since 20 Feb 2008
Offline Last Active Aug 25 2015 09:24 PM

Topics I've Started

Life Saver

30 December 2012 - 09:27 AM

- Life Saver -

Life Saver is a game about talking yourself into not committing suicide. It is not finished yet, and I'd consider this a proof-of-concept type of work.
For what it is, I hope you enjoy the dialogue and effects. Thanks, and please leave comments! They're greatly appreciated here at the GMC :thumbsup:

No images, sorry folks!
Download (2.1 MB)

Finding Theta in a Trajectory

23 October 2012 - 10:53 PM


I've recently programmed a game using projectile motion. When the ball is launched, I calculate the displacement of both x and y using the linear equations:

time += 0.1;
xx = mag * cos(theta) * time;
yy = -(mag * sin(theta) * time) + .5 * grav * power(time, 2);

The first, x = v(xi)t, resembles the horizontal displacement of the projectile.
The second, y = v(yi)t - .5gt^2, resembles the vertical displacement of the projectile. Since up is negative and down is positive in programming, I changed the equation accordingly.

With both velocity vectors, I know that I can find theta with arctan(), but the angle is never correct and never exceeds 0 degrees (to the right). How do I fix this? Also, I use a custom time. How do I use real time to calculate the displacement? I'm assuming the time might be screwing up my angle.

I hope you can help.

Backspace Problems

17 July 2012 - 01:58 AM


I'm using this code in the <Any Key> event in order to type a name:
if (keyboard_check(vk_backspace)) {
        name = string_copy(name, 1, string_length(name) - 1);
    if (string_length(name) < nameMax) {
        if (keyboard_check(ord('3')) && keyboard_check(vk_shift)) keyboard_string = "";
        name += keyboard_string;
    keyboard_string = "";
The problem is the backspacing. If I take out "keyboard_wait();", then whenever I press backspace my string instantly deletes 1 character at a time without a delay.
I used keyboard_wait(); to simulate this delay, but it's being funky. Usually in Windows, when you delete something, there's a delay with the deletion of the first character you want to delete, and THEN the deletion becomes continuous. The keyboard_wait() function doesn't delete the last character and have a delay simultaneously. What do I do?

Recursive Scripts

14 July 2012 - 02:14 AM


Is it possible to run more than 1 script of the same script?


var x;
x = argument0;
for (i = 1; i < 4; i += 1) {
scriptTest(x + i);

Can I make it so that scriptTest will run 3 times after it's initiated from a for loop? Or will the current running script be terminated?

Find Direction Using 1 Coordinate

09 July 2012 - 11:51 PM


I have two variables that represent X and Y coordinates.
They could be -1, 0, and 1 for each, so there are plenty of combinations for coordinates (the unit circle, essentially).

How would I take one coordinate and turn it into a direction of a compass?
For example, (1,0) would translate to 0 degrees while (-1, -1) correlates to 225 degrees?

Help would be appreciated. Thanks.