Jump to content

Bu Oyunu Sayfama Göre Ayarlayamadım


Recommended Posts

Merhaba Üstadlar;

Aşağıdaki linkte bir oyun var.Ben bu oyunu siteme koymak istiyorum fakat oyunun arka plan rengi sitemin düzenini bozuyor.Ben sadece bu oyun penceresini siteme koymak istiyorum,bir türlü halledemedim.
Yardımcı olabilir misiniz acaba?

oyun linki:

[url="http://www.javascriptindir.com/indir.asp?id=52&sIslem=İndir"]http://www.javascriptindir.com/indir.asp?id=52&sIslem=İndir[/url]
Link to comment
Share on other sites

hocam tetris.html dosyasının içinde javascript kodları var.mesela:
[code]body {
background: #E1D4C0;
}[/code]
yazıyor.burdaki [color="#FF0000"]#E1D4C0[/color] renk kodudur. [color="#FF0000"]#FFFFFF[/color] yaparsan beyaz olur.Google'dan renk kodları diye ararsan istediğin rengi bulabilirsin.
[code] #tetris {
position: relative;
width: 300px;
height: 310px;
top: 50px;
left: 50px;
border: 1px solid #BAA68E;
background: #ffffff;
}[/code]
width: [color="#FF0000"]300[/color]px; genişlik, height: [color="#FF0000"]310[/color]px; yüksekliktir.top ve left satırını silersen yukarı ve sola yaslanır.
buradaki kodları düzenledikten sonra iframe koduyla sitene entegre edebilirsin.
<iframe width="300" height="310" src="http://www.site.com/Tetris.html"></iframe> gibi

Edited by Lastman
Link to comment
Share on other sites

Lastman hocam;

Özel mesajdan sonra birşey denedim ve oldu.Oyun şimdi sitemde...

Fakat oyun oynarken aşağı,sağa,sola tuşları ''yön tuşlarına'' atandığı için tüm sayfa hareket ediyor.Ben biraz js kodunu karıştırdım oyunun.


[color="#ff0000"][b][u]OYUNUN JS KODUNUN BİR BÖLÜMÜ:[/u][/b][/color]

/**
* Assigning functions to keyboard events
* When key is pressed, searching in a table if any function has been assigned to this key, execute the function.
*/
function Keyboard() {

[color="#ff0000"] this.up = 38;
this.down = 40;
this.left = 37;
this.right = 39;
this.n = 78;
this.r = 82;
this.space = 32;
this.f12 = 123;
this.escape = 27;[/color]

this.keys = [];
this.funcs = [];

var self = this;

/**
* @param int key
* @param function func
* @return void
* @access public
*/
this.set = function(key, func) {
this.keys.push(key);
this.funcs.push(func);
}

/**
* @param object e
* @return void
* @access event
*/


Gördüm ki,kırmızı ile işaretlediğim bölüm HEX tuşları kodları.Ben bu oyunun tuş takımlarını rakamlara atamak istiyorum.
BEN bunu HEX kodlarını değiştirerek yaptım fakat klavyenin sağ tarafındaki rakamlardan çalışmadı.Klavyenin üst kısmında duran rakamlarla çalıştı oyun.

Sizden ricam bu klavyenin sağındaki rakamları kullanabilmem için ne yapmalıyım.O rakamların ayrı bir HEX kodu var mı???
Bu sorunun cevabı beni çözüme götürecektir...

Edited by volkantr19
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...