Jump to content


alfa64

Member Since 10 Jul 2010
Offline Last Active Feb 14 2012 12:13 AM

Topics I've Started

Unknown variable is driving me !sane

13 February 2012 - 08:11 PM

I'm writing a prototype for a game in game maker, wich is great, but a bug is slowing me down a lot.
I've got the classic stuff:

in the step event of enemies:
if ( y > 490) or ( hp <= 0) or (x<= -10) or (x>= 400)
{
    instance_destroy();
}

in the collision event of the sword:

if (hit <4 ){
hit+=1;
}
else
{
valor = irandom(10);
    if (valor >2)
    { 
        if ((other.hp - (valor+player.level*player.powa)) <=0)
        {
            player.experience+=other.ex;
            with(other)
           {
                       hp-=(other.valor+player.level);
                       y-=16*player.powa+irandom(16);
            }
        }
        else
        {
             with(other)
            {
                       hp-=(other.valor+player.level);
                       y-=16*player.powa+irandom(16);
            }
        }
    }
   hit=0;
    }

What happens then is that i kill some bad guys and then for some reason this errors comes up:



___________________________________________
ERROR in
action number 1
of  Step Event
for object badguy:

Error in code at line 1:
   if ( y > 490) or ( hp <= 0) or (x<= -10) or (x>= 400)
                     ^
at position 20: Unknown variable hp

Any thoughts?

In the create event for badguy i have this:
hp=10;
ex=20;

Multiple rooms and instances comunicating.

20 May 2011 - 10:07 PM

Hello, i'm back to game maker from a long break. What i'm trying to achieve is this flow:

Player shoots proyectile in starting room1> proyectile impacts certain enemy > screen switches to simple minigame room2 > player appears in room3 > clears room and goes back to room1

The problem is that i can't destroy the "certain enemy" in room1 from room3.

I thought of using views, but i have a different room for each miniboss.

What's your solution to this? Thanks in advance.

Railgun or Infinite velocity weapon?

11 September 2010 - 04:50 AM

Hello fellow gamemakers, in this episode i will ask you this:
have you ever played quake 2 or 3? How do you calculate the hit with an instance or scenery in one step?
I want to achieve something like the shotgun in SHOTGUN NINJA:
http://db.tigsource....s/shotgun-ninja

( TRY THAT GAME, IT'S AWESOME )
My game uses the same perspective, but ofcourse it will be the same for a TDS or something like that.
Any ideas?

Platform Shooter - Can't choose aiming

20 August 2010 - 08:47 PM

Hello, i'm making a platform shooter with big weapons and stuff, but i fell that aiming with the directional buttons just doesn't cut it, and aiming with the mouse makes things too easy to shoot but extremely hard to avoid with the player's character.

What do you suggest? Any succesful platform shooter that uses the mouse to aim (gameplay wise, not fame or such) ?

Thanks in advance.

Follow your leader little peoples!

02 August 2010 - 03:41 AM

Hello gamemakers, i've got an easey one for you today.
I've got a little top down game on wich a bunch of small people follows you when you call them. Something like Pikmin(Gamecube, Wii). I just can't figure how to make them follow the character in a natural way.
This is what i've been doing:

target = instance_nearest(character);
step_towards(target.x,target.y,speed);

But it's bad and slow. So i thought about setting up a leader for them to follow, and the leader follows my character.

Also it's important that they move like a mass of people, not overlapping and not in a queue.

Any thoughts?