Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Simple enemy example GM 6 non-reg (STILL NEED HELP) ANYONE!!!!!!!!!!!  (Read 1053 times)

0 Members and 1 Guest are viewing this topic.
Simple enemy example GM 6 non-reg (STILL NEED HE...
« on: June 28, 2007, 01:37:00 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 51
Hi
As you might know my friend and I are making a Zelda game and once again we need more help. Does any one have or can make me a SIMPLE enemy example engine. I need one that has bad guys walking around randomly, then when Link comes close they charge to him. I've seen some BG examples and i really can't comprhend them, so if anyone has any examples, please contribute them.
Thanks 
XD
~CJ
« Last Edit: August 01, 2007, 03:25:26 am by Jetsvaoe »
Logged
~CJ






Re: Simple enemy example GM 6 non-reg (STILL NEE...
« Reply #1 on: August 08, 2007, 03:21:22 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 51
ANYBODY PLEASE!!!!!!!!
Logged
~CJ






Koh

Re: Simple enemy example GM 6 non-reg (STILL NEE...
« Reply #2 on: August 08, 2007, 04:35:57 am »
  • Tamer Koh
  • *
  • Reputation: +6/-0
  • Offline Offline
  • Gender: Male
  • Posts: 980
Try this

Create Event
Code: [Select]
facing="D"
moveable=1
facewait=0

Alarm[0] Event
Code: [Select]
facewait=0

Step Event
Code: [Select]
if distance_to_object(objLink)<=64{
    if !facewait{
        if objLink.y<y{
            facing="U"
        }
        else if objLink.y>y{
            facing="D"
        }
        if objLink.x<x{
            facing="L"
        }
        else if objLink.x>x{
            facing="R"
        }
        facewait=1
    }
}
else{
    if !facewait{
        switch floor(random(4)){
            case 0: facing="D"; break;
            case 1: facing="U"; break;
            case 2: facing="L"; break;
            case 3: facing="R"; break;
        }
        facewait=1
    }
}
if moveable{
    if facing="D"{
        if place_free(x,y+1){
            y+=1
        }
    }
    if facing="U"{
        if place_free(x,y-1){
            y-=1
        }
    }
    if facing="L"{
        if place_free(x-1,y){
            x-=1
        }
    }
    if facing="R"{
        if place_free(x+1,y){
            x+=1
        }
    }
}
if facewait && !alarm[0]{
    alarm[0]=floor(random(21))+10
}

execute_string('sprite_index=sprEnemy'+facing)
Logged
  • Megaclipse Games
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.563 seconds with 43 queries.