Jump to content


Figuras

Member Since 22 Jul 2007
Offline Last Active Jul 29 2012 03:20 PM

Posts I've Made

In Topic: Broken variables?

18 March 2012 - 07:22 PM

Oh right. I didn't take a closer look on what the line Menu(global.Paused) actually does. ^^

In Topic: Broken variables?

18 March 2012 - 07:16 PM

Thats just the old mistake every new programmer will make (and advanced ones too :D).
You say:
if false set true
if true set false
So it will set it true because it's false, and then immediately set it false again, because it's true.

You have to stop the script after it has checked ONE of these conditions. You can do it with exit.

if keyboard_check(81)
{
    Menu(global.Paused)

    if global.Paused = false
    {
        global.Paused = true
        exit
    }
    if global.Paused = true
    {
        global.Paused = false
        exit
    }
}

In Topic: motion_set

18 March 2012 - 06:20 PM

First of all, your code seems to be in a step event. That means, the object will change its direction 30 times in a second. Well, that can't look very natural.
So first, you should put this code in an alarm event. And then you can randomize the alarm time.
// in the create event:
alarm[0] = irandom_range(30,90)  // this will set the alarm to 1-3 seconds (with default room speed)
// in the alarm[0] event:
motion_set(choose(135,90,45,0,315,270,225,180),5);
{
    if (irandom(3)=0)  // simplified
    move_towards_point(obj_player.x,obj_player.y,5);
}
alarm[0] = irandom_range(30,90)
So, the object will move to a direction for a randomized number between 30 and 90 steps (1 and 3 seconds) and then change the direction (and sometimes move towards the player).
This is still a very basic A.I. though, but will do to begin with.

In Topic: Fantasy Platformer Attack Issue

18 March 2012 - 02:02 PM

No, you should create one topic for each question. Especially if you want to get answers from people who are savvier than me. ;)

In Topic: Fantasy Platformer Attack Issue

18 March 2012 - 01:49 AM

Hehe yeah, when it gets a little bit complicated it's sometimes hard to explain what you mean in a written post. So don't worry, I'm also somewhat muddleheaded and often tend to go into detail too much, which might be confusing then. :)
And I understand you: I was also overly ambitious when I started using GM, and actually I still am. But unlike you I was still struggling with the easiest drag and drop functions after two weeks.

But the important thing is that your code works now as you want it to. I hope to see the further progress of the game or at least the finished version then.
And for your glitches and future issues, you know where to get help now. :) But watch out, I might make another confusing reply so we'd have another thread like this (I enjoyed it). :biggrin: