my game

Posted by Joshuaallen64 on April 15, 2007, 7:34 p.m.

I think my game is coming along nicely but that sprites is jest killing me. I am making the tiles for the interior of the houses and that is taking days. I still need to do better trees but those will be hard to do. I should git the signs sprited and coded for the next update.

I'm thinking about changing the mini map a little. Right now it is jest a black background that is transparent but if I take a snapshot of the hole room and re size it. That should make it look a little better.

The game will have 16 rooms all 2000*2000. In thenext update I should have all 16 room dune so you can walk around but that's all your going to be able

to do until I add some more things.

That is what it should look like when I'm dune.

I am very proud of the script I made for the movement. It also is for the NPC.

/*
argument4=if it is a NPC or not

*/
depth=-y
var moving_v,moving_h,ss,d_left,face;
up=argument0
down=argument1
left=argument2
right=argument3
NPC=argument4
moving_v=false
moving_h=false
p_up=true
p_down=true
p_left=true
p_right=true
ss=2
d_left=true
face=true

if vspeed<0{sprite_index=up;moving_v=true;moving_h=false;image_speed=0.2}
if vspeed>0{sprite_index=down;moving_v=true;moving_h=false;image_speed=0.2}
if hspeed<0{sprite_index=left;moving_h=true;moving_v=false;image_speed=0.2}
if hspeed>0{sprite_index=right;moving_h=true;moving_v=false;image_speed=0.2}

if moving_v=false && moving_h=false{image_index=0;image_speed=0}
if moving_v=true{if image_index<1{image_index=1}}

// This is for you main chr
if object_index=obj_player{

if collision_line(x,y+21,x,y+33,obj_block,false,true){p_left=false}
if collision_line(x+32,y+21,x+32,y+33,obj_block,false,true){p_right=false}
if collision_line(x+2,y+19,x+30,y+19,obj_block,false,true){p_up=false}
if collision_line(x+2,y+35,x+30,y+35,obj_block,false,true){p_down=false}

//speeding up
if keyboard_check(vk_shift){ss=3}
if p_up=false{if vspeed=-ss{vspeed=0}}
if p_down=false{if vspeed=ss{vspeed=0}}
if p_left=false{if hspeed=-ss{hspeed=0}}
if p_right=false{if hspeed=ss{hspeed=0}}

//moving
if p_up=true{if !keyboard_check(vk_down){if keyboard_check(vk_up){vspeed=-ss;face=false}}}
if p_down=true{if !keyboard_check(vk_up){if keyboard_check(vk_down){vspeed=ss;face=false}}}
if p_left=true{if !keyboard_check(vk_right){if keyboard_check(vk_left){hspeed=-ss;face=false}}}
if p_right=true{if !keyboard_check(vk_left){if keyboard_check(vk_right){hspeed=ss;face=false}}}

    //stop moving
    if !keyboard_check(vk_down){if keyboard_check_released(vk_up){vspeed=0}}
    if !keyboard_check(vk_up){if keyboard_check_released(vk_down){vspeed=0}}
    if !keyboard_check(vk_right){if keyboard_check_released(vk_left){hspeed=0}}
    if !keyboard_check(vk_left){if keyboard_check_released(vk_right){hspeed=0}}

//fasing
if face=true{if !keyboard_check(vk_down){if keyboard_check(vk_up){if p_up=false{sprite_index=up}}}}
if face=true{if !keyboard_check(vk_up){if keyboard_check(vk_down){if p_down=false{sprite_index=down}}}}
if face=true{if !keyboard_check(vk_right){if keyboard_check(vk_left){if p_left=false{sprite_index=left}}}}
if face=true{if !keyboard_check(vk_left){if keyboard_check(vk_right){if p_right=false{sprite_index=right}}}}

//sets the new keys
keyboard_set_map(ord("W"),vk_up)
keyboard_set_map(ord("S"),vk_down)
keyboard_set_map(ord("A"),vk_left)
keyboard_set_map(ord("D"),vk_right)

}

// This is for you NPC
if argument4=true{
//block
if collision_line(x,y+21,x,y+30,obj_block,false,true){npc_direction=0;npc_doing=choose(0,1,2,3)
npc_direction=100}
if collision_line(x+32,y+21,x+32,y+30,obj_block,false,true){npc_direction=0;npc_doing=choose(0,1,3,4)
npc_direction=100}
if collision_line(x+2,y+19,x+30,y+19,obj_block,false,true){npc_direction=0;npc_doing=choose(0,2,3,4)
npc_direction=100}
if collision_line(x+2,y+32,x+30,y+32,obj_block,false,true){npc_direction=0;npc_doing=choose(0,1,2,4)
npc_direction=100}
if collision_line(x,y+21,x,y+30,obj_block2,false,true){npc_direction=0;npc_doing=choose(0,1,2,3)
npc_direction=100}
if collision_line(x+32,y+21,x+32,y+30,obj_block2,false,true){npc_direction=0;npc_doing=choose(0,1,3,4)
npc_direction=100}
if collision_line(x+2,y+19,x+30,y+19,obj_block2,false,true){npc_direction=0;npc_doing=choose(0,2,3,4)
npc_direction=100}
if collision_line(x+2,y+32,x+30,y+32,obj_block2,false,true){npc_direction=0;npc_doing=choose(0,1,2,4)
npc_direction=100}
//player
if collision_line(x-15,y+10,x-15,y+40,obj_player,false,true){npc_doing=0;sprite_index=left}
if collision_line(x+47,y+10,x+47,y+40,obj_player,false,true){npc_doing=0;sprite_index=right}
if collision_line(x+2,y+4,x+30,y+4,obj_player,false,true){npc_doing=0;sprite_index=up}
if collision_line(x+2,y+47,x+30,y+47,obj_player,false,true){npc_doing=0;sprite_index=down}

if npc_doing=0{hspeed=0;vspeed=0}//stop
if npc_doing=1{hspeed=0;vspeed=-1}//up
if npc_doing=2{hspeed=1;vspeed=0}//right
if npc_doing=3{hspeed=0;vspeed=1}//down
if npc_doing=4{hspeed=-1;vspeed=0}//left
if npc_doing=5{hspeed=1;vspeed=-1}//up, right
if npc_doing=6{hspeed=1;vspeed=1}//down. right
if npc_doing=7{hspeed=-1;vspeed=1}//up, left
if npc_doing=8{hspeed=-1;vspeed=-1}//down, left
if npc_doing=9{hspeed=0;vspeed=0;move_towards_point(xstart,ystart,1)}
if npc_doing=10{hspeed=-hspeed}
if npc_doing=11{vspeed=-vspeed}

npc_direction+=1
if npc_direction>100{if distance_to_point(xstart,ystart)>50{npc_doing=9}else
{npc_doing=choose(0,1,2,3,4,5,6,7,8)npc_direction=0}}}

Comments

Rob 18 years, 10 months ago

And we care because?

Joshuaallen64 18 years, 10 months ago

who is apart of this "we"

I only see one post so that cant be it

you are only one person so that cant be it

is "we" 64digits because I'm in it and I care

so next time don't be an ass