Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.



 
InícioPortalAI inteligencia artificial BlogRegistarÚltimas imagensAI inteligencia artificial Orkut10RegrasEntrar

 

 AI inteligencia artificial

Ir para baixo 
AutorMensagem
vinivergil
Spriter
Spriter
vinivergil


Masculino Número de Mensagens : 127
Idade : 27
Warning : 0%
Premios :
AI inteligencia artificial Trophy10: 0
AI inteligencia artificial Trophy11: 0
AI inteligencia artificial Trophy12: 0
Habilidade 1 : AI inteligencia artificial Gm11
Habilidade 2 : AI inteligencia artificial Spriti10

AI inteligencia artificial Empty
MensagemAssunto: AI inteligencia artificial   AI inteligencia artificial Icon_minitimeDom Ago 02, 2009 8:46 pm

Começe com os sprites
vc precisa de sprites:
Inimigo:
inimigo_parado
inimigo_andando
inimigo_pulando
inimigo_kunai


agora crie os objetos:

obj_inimigo:
CREATE/CODIGO:
image_speed = 0.2;
gravity_direction = 270;
dir = choose(1,-1)
seen = 0
canshoot = true
hp = 5
sightdistance = 200
sightheight = 40
wspeed = 1.5
knifing = 0
scared = 0

ALARM 0/ CODIGO:
canshoot = true

STEP / CODIGO:

if (place_free(x, y + 1))
{
gravity = 0.5
;}
else
{
gravity = 0;
}
vspeed = min(12, vspeed);

if seen = 0{
movment()
jump()
}

if scared = 0{
if seen = 1{
if knifing = 0{shooting()}
knife()
}
}

if hp<2 {scared = 1}
if scared = 1{
movment()
run_away()
jump()
}

if hp = 0{instance_destroy()}

if scared = 0{
if distance_to_object(obj_player) < sightdistance {seen = 0 // and the player is out of sight, we cant se them
if obj_player.x>x then {dir = 1}
if obj_player.x}
}


COLISION -obj_block-/ CODIGO

if (vspeed > 0 && !place_free(x, y + vspeed))
{
move_contact_solid(270, 4);
}
vspeed = 0;


COLISION -obj_tiro_player- / CODIGO

seen = 1
hp -=1

COLISION -obj_dir_change- (se não tiver crie) / CODIGO

if scared = 0{
if dir = 1 {dir = -1}
else
if dir = -1 {dir = 1}
}

Animation end / CODIGO

if sprite_index = bad_guy_knife {knifing = 0}
sprite_index = bad_guy_stand

DRAW / CODIGO

draw_sprite_ext(sprite_index,image_index,x,y,dir,image_yscale,image_angle,image_blend,image_alpha)
if scared = 0{
scr_EnemyView(sightheight,sightdistance);
}

o inimigo ta pronto!

os objetos tem que ja estarem feitos

té +
Ir para o topo Ir para baixo
 
AI inteligencia artificial
Ir para o topo 
Página 1 de 1

Permissões neste sub-fórumNão podes responder a tópicos
 :: Makers :: GameMaker :: Tutoriais -
Ir para: