04-06-2008, 04:12 PM
2 tane sprite oluşturalım birinin uzunlukları width: 16 height:32 olsun siyah renk olsun sadece ödürkide height 16 width:32olsun siyah renk olsun 1sprite dha yapak onada -'- Silahlı oyundaki gbi olcak resim sagdan soldan üstten alttan çizgi yani bilirsiniz hadef şeyi ondan çizin width:32 height:32olsun +yapın işte şimdi 2 tane backgraund olsun bi yerin rengi bide hava işte yerin ismi wall1 olsun back graund unda background2 olsun şimdi obje yapalım oyuncu die oyuncu die boş obje create ye bu kod
[/code]friction=0.2;
instance_create(x,y,tabanca);
d3d_start();
d3d_set_hidden(true);
d3d_set_lighting(false);
d3d_set_culling(false);
texture_set_interpolation(true);
height=0
pitch=0
direction -= (display_mouse_get_x() -display_get_width()/2)/10;
pitch += (display_mouse_get_y() -display_get_height()/2)/400;
display_mouse_set(display_get_width()/2,display_get_height()/2);
pitch = max(min(pitch,89),-89);
global.camx=x;
global.camy=y;
global.camsin=sin(self.direction*pi/180);
global.camcos=cos(self.direction*pi/180);
var xn,yn,inst;
xn = x - sin(direction*pi/180);
yn = y - cos(direction*pi/180);
if not place_meeting(xn,yn,duvarlar)
{ x = xn; y = yn; }
else{
inst=place_meeting(xn,yn,duvarlar)
if (inst.height>self.height){
x = xn; y = yn; }
}
var xn,yn,inst;
xn = x + sin(direction*pi/180);
yn = y + cos(direction*pi/180);
if not place_meeting(xn,yn,duvarlar)
{ x = xn; y = yn; }
else{
inst=place_meeting(xn,yn,duvarlar)
if (inst.height>self.height){
x = xn; y = yn; }
}
w ye su kod
drav a da su kod
//set the projection
d3d_set_projection(x,y,10+height+pitch,x+cos(direction*pi/180),y-sin(direction*pi/180),10+height,0,0,1);
d3d_draw_floor(0,0,0,room_width,room_height,0,background_get_texture(fc12),24,18);
x1=x;
x2=x;
y1=y-16;
y2=y+16;
z1=32;
z2=0;
height=22;
tex=background_get_texture(wall1);
x1=x-16;
x2=x+16;
y1=y;
y2=y;
z1=32;
z2=0;
height=22;
tex=background_get_texture(wall1);
[/code]friction=0.2;
instance_create(x,y,tabanca);
d3d_start();
d3d_set_hidden(true);
d3d_set_lighting(false);
d3d_set_culling(false);
texture_set_interpolation(true);
height=0
pitch=0
Kod:
stepe bu koddirection -= (display_mouse_get_x() -display_get_width()/2)/10;
pitch += (display_mouse_get_y() -display_get_height()/2)/400;
display_mouse_set(display_get_width()/2,display_get_height()/2);
pitch = max(min(pitch,89),-89);
Kod:
end stepe bu kodglobal.camy=y;
global.camsin=sin(self.direction*pi/180);
global.camcos=cos(self.direction*pi/180);
Kod:
a key yani sag tuşda olabilir a da
bu kodxn = x - sin(direction*pi/180);
yn = y - cos(direction*pi/180);
if not place_meeting(xn,yn,duvarlar)
{ x = xn; y = yn; }
else{
inst=place_meeting(xn,yn,duvarlar)
if (inst.height>self.height){
x = xn; y = yn; }
}
Kod:
d tuşuna sü kodxn = x + sin(direction*pi/180);
yn = y + cos(direction*pi/180);
if not place_meeting(xn,yn,duvarlar)
{ x = xn; y = yn; }
else{
inst=place_meeting(xn,yn,duvarlar)
if (inst.height>self.height){
x = xn; y = yn; }
}
Kod:
s ye şu kod
[code]
{
var maxspeed;
if keyboard_check(vk_shift) maxspeed = 3 else maxspeed = 3;
if (speed > -maxspeed) speed = max(-maxspeed,speed-0.4);
}Kod:
{
var maxspeed;
if keyboard_check(vk_shift) maxspeed = 3 else maxspeed = 3;
if (speed < maxspeed ) speed = min(maxspeed ,speed+0.4);
}//set the projection
d3d_set_projection(x,y,10+height+pitch,x+cos(direction*pi/180),y-sin(direction*pi/180),10+height,0,0,1);
d3d_draw_floor(0,0,0,room_width,room_height,0,background_get_texture(fc12),24,18);
Kod:
wall1 h diye obje yukarı aşaga uzun olan siyah sprşteyi seçin
create e şu kodx2=x;
y1=y-16;
y2=y+16;
z1=32;
z2=0;
height=22;
tex=background_get_texture(wall1);
Kod:
şimdi wall1 v die obje
sag sola uzun olan sprite olsun olsun
şu kod create ex2=x+16;
y1=y;
y2=y;
z1=32;
z2=0;
height=22;
tex=background_get_texture(wall1);
Kod:
şimdi deneyelim bakalım nsl oldu
DEVAMI VAR