Jump to content


I Am Moo

Member Since 25 Dec 2007
Offline Last Active Dec 29 2007 11:59 PM

Posts I've Made

In Topic: Battle Armor - Tds (not Abandoned!)

27 December 2007 - 11:07 PM

Hehe, really good game Templar, but heck, my comp won't support it O.O

In Topic: Snake

27 December 2007 - 08:37 PM

I suggest you go at "www.yoyogames.com" and download the tutorial "First Game". Then look around the help file. Remember this forum is for questions, not for asking the community to do your whole game.

In Topic: How Can I...

27 December 2007 - 07:20 PM

Pwned, please use relevant titles O.O not "How Can I..."

In Topic: Animate A Sprite Only Once [solved]

27 December 2007 - 07:06 PM

Not really, I downloaded GM 3 days ago O.O

In Topic: Animate A Sprite Only Once [solved]

27 December 2007 - 07:00 PM

Hey GMC! I fixed my problem!
Finally, I used :) Animation End.
I also set a global variable indicating the last sprite used before all my "sprite_index=..." codes, so that it would always remember which last sprite was used in the Animation End code, and set it to 0.

Here's the Info about Link, if anyone's interested! ;)
Information about object: Link

Sprite: link_stand
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: link_mask_spr

Create Event:
execute code:

globalvar link_direction;
globalvar lastsprite;
image_speed = 0;
global.link_direction="down";

 Step Event:
execute code:

//Follow Link
view_xview = x - 120
view_yview = y - 80

if view_xview < 0 { view_xview = 0; }
if view_xview > room_width-view_wview { view_xview = room_width-view_wview; }
if view_yview < 0 { view_yview = 0; }
if view_yview > room_height-view_hview { view_yview = room_height-view_hview; }

//Attack with sword
if (keyboard_check(vk_control) == true)
  {
  if (global.link_direction == "down")
    {
    if (sprite_index !=link_attack_s)
      {
      global.lastsprite=sprite_index
      sprite_index = link_attack_s;
      }
    image_speed=1
    }
  }
  
if (keyboard_check(vk_left) == true)
  {
  if (sprite_index != link_walk_w)
    {
    global.lastsprite=sprite_index
    sprite_index = link_walk_w;
    }
  x -= 3;
  image_speed = 0.65;
  global.link_direction="left";
  }
  
if (keyboard_check(vk_right) == true)
  {
  if (sprite_index != link_walk_e)
    {
    global.lastsprite=sprite_index
    sprite_index = link_walk_e;
    }
  x += 3;
  image_speed = 0.65;
  global.link_direction="right";
  }
  
if (keyboard_check(vk_up) == true)
  {
  if (sprite_index != link_walk_n)
    {
    global.lastsprite=sprite_index
    sprite_index = link_walk_n;
    }
  y -= 3;
  image_speed = 0.65;
  global.link_direction="up";
  }
  
if (keyboard_check(vk_down) == true)
  {
  if (sprite_index != link_walk_s)
    {
    global.lastsprite=sprite_index
    sprite_index = link_walk_s;
    }
  y += 3;
  image_speed = 0.65;
  global.link_direction="down";
  }

if (keyboard_check(vk_left) == false && keyboard_check(vk_right) == false && keyboard_check(vk_up) == false && keyboard_check(vk_down) == false)
  {
  if (sprite_index == link_walk_s)
    {
    global.lastsprite=sprite_index
    sprite_index = link_stand
    image_speed = 0;
    image_index = 0;
    global.link_direction="down";
    }
  if (sprite_index == link_walk_e)
    {
    global.lastsprite=sprite_index
    sprite_index = link_stand
    image_speed = 0;
    image_index = 1;
    global.link_direction="right"
    }
  if (sprite_index == link_walk_n)
    {
    global.lastsprite=sprite_index
    sprite_index = link_stand
    image_speed = 0;
    image_index = 2;
    global.link_direction="up"
    }
  if (sprite_index == link_walk_w)
    {
    global.lastsprite=sprite_index
    sprite_index = link_stand
    image_speed = 0;
    image_index = 3;
    global.link_direction="left"
    }
  }
  
if (place_meeting(x,yprevious,miniblocked) == true)
  {
  x = xprevious;
  }
if (place_meeting(xprevious,y,miniblocked) == true)
  {
  y = yprevious;
  }
  

Collision Event with object miniblocked:
execute code:

x=xprevious
y=yprevious

Keyboard Event for F2 Key:
execute code:

x=xstart
y=ystart

Other Event: Animation End:
execute code:

if (sprite_index==link_attack_s)
  {
  sprite_index=global.lastsprite
  image_speed=0;
  image_index=0;
  }