你可以先去【繪學(xué)霸】網(wǎng)站找“游戲特效/unity3D”板塊的【免費】視頻教程-【點擊進入】完整入門到精通視頻教程列表: ;tagid=305,306zdhhr-11y17r-239619078

創(chuàng)新互聯(lián)成立于2013年,先為烏海等服務(wù)建站,烏海等地企業(yè),進行企業(yè)商務(wù)咨詢服務(wù)。為烏海企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。
想要系統(tǒng)的學(xué)習(xí)可以考慮報一個網(wǎng)絡(luò)直播課,推薦CGWANG的網(wǎng)絡(luò)課。老師講得細,上完還可以回看,還有同類型錄播課可以免費學(xué)(贈送終身VIP)。
自制能力相對較弱的話,建議還是去好點的培訓(xùn)機構(gòu),實力和規(guī)模在國內(nèi)排名前幾的大機構(gòu),推薦行業(yè)龍頭:王氏教育。
王氏教育全國直營校區(qū)面授課程試聽【復(fù)制后面鏈接在瀏覽器也可打開】:
在“游戲特效/unity3D”領(lǐng)域的培訓(xùn)機構(gòu)里,【王氏教育】是國內(nèi)的老大,且沒有加盟分校,都是總部直營的連鎖校區(qū)。跟很多其它同類型大機構(gòu)不一樣的是:王氏教育每個校區(qū)都是實體面授,老師是手把手教,而且有專門的班主任從早盯到晚,爆肝式的學(xué)習(xí)模式,提升會很快,特別適合基礎(chǔ)差的學(xué)生。
大家可以先把【繪學(xué)霸】APP下載到自己手機,方便碎片時間學(xué)習(xí)——繪學(xué)霸APP下載:
俄羅斯方塊這些簡單的游戲其實 html + css + js 就可以實現(xiàn)了。 樓主已經(jīng)為c語言了,js和后臺語言比如java c#等很接近,學(xué)起來應(yīng)該很快。 html5+css3 會更加炫酷。基礎(chǔ)還要掌握html css 和 js。
html
head
title標題/title
/head
body
style
span.btn
{
BORDER-RIGHT: #7b9ebd 1px solid;
PADDING-RIGHT: 2px;
BORDER-TOP: #7b9ebd 1px solid;
PADDING-LEFT: 2px;
FONT-SIZE: 12px;
FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde);
BORDER-LEFT: #7b9ebd 1px solid;
COLOR: black;
PADDING-TOP: 2px;
BORDER-BOTTOM: #7b9ebd 1px solid;
background-color: #CCCCCC;
}
/style
script language="javascript"
var doing;
var candown=0;
var wnum=13;
var hnum=18;
var grid=new Array();
var gridBuf=new Array();
for(i=0;i=hnum;i++){
grid[i]=new Array();
gridBuf[i]=new Array();
for(j=0;j=wnum;j++){
if(j0 jwnum ihnum){
grid[i][j]=0;
gridBuf[i][j]=0;
}else{
grid[i][j]=1;
gridBuf[i][j]=1;
}
}
}
var boxdata=
[
[
[1,1,1,1],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]
],
[
[1,1,1,0],
[1,0,0,0],
[0,0,0,0],
[0,0,0,0],
],
[
[1,1,1,0],
[0,1,0,0],
[0,0,0,0],
[0,0,0,0]
],
[
[1,1,1,0],
[0,0,1,0],
[0,0,0,0],
[0,0,0,0]
],
[
[1,1,0,0],
[0,1,1,0],
[0,0,0,0],
[0,0,0,0]
],
[
[0,1,1,0],
[1,1,0,0],
[0,0,0,0],
[0,0,0,0]
],
[
[1,1,0,0],
[1,1,0,0],
[0,0,0,0],
[0,0,0,0]
]
];
var colors=["black","#A0A0A0","red","#FF8000","yellow","pink"];
var gotLine=0;
var box;
var bGameOver=false;
function getHeight(arr)
{
var i,j;
for(i=3;i=0;i--)
for(j=0;j4;j++)
if(arr[i][j]) return i;
}
function getWidth(arr)
{
var i,j;
for(i=3;i=0;i--)
for(j=0;j4;j++)
if(arr[j][i]) return i;
}
function Box(x,y,arr,color)
{
this.arr=arr;
this.x=x;
this.y=y;
this.w=getWidth(arr);
this.h=getHeight(arr);
this.color=color;
this.active=true;
this.clearOldBox=function()
{
for(var j=0;j=this.h;j++)
for(var i=0;i=this.w;i++)
if(this.arr[j][i]0) grid[this.y+j][this.x+i]=0;
}
this.putNewBox=function()
{
for(var j=0;j=this.h;j++)
for(var i=0;i=this.w;i++)
if(this.arr[j][i]0) grid[this.y+j][this.x+i]=this.color;
}
this.moveLeft=function()
{
this.clearOldBox();
var _x=this.x-1;
if(this.canMove(_x,this.y)) this.x=_x;
this.putNewBox();
drawGrid();
}
this.moveRight=function()
{
this.clearOldBox();
var _x=this.x+1;
if(this.canMove(_x,this.y)) this.x=_x;
this.putNewBox();
drawGrid();
}
this.moveDown=function()
{
this.clearOldBox();
var _y=this.y+1;
if(this.canMove(this.x,_y)){
this.y=_y;
this.putNewBox();
drawGrid();
}else{
this.putNewBox();
drawGrid();
checkLineFull();
return;
}
}
this.rotate=function()
{
var tmp=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]];
for(j=0;j=this.h;j++)
for(i=0;i=this.w;i++)
tmp[this.w-i][j]=this.arr[j][i];
var newBox=new Box(this.x,this.y,tmp,this.color);
this.clearOldBox();
if(! newBox.canMove(this.x,this.y)) this.putNewBox();
else
{
box=newBox;
box.putNewBox();
drawGrid();
}
}
this.canMove=function(x,y)
{
for(var j=0;j=this.h;j++)
for(var i=0;i=this.w;i++)
{
if(grid[y+j][x+i]!=0 this.arr[j][i]!=0){ candown=1;return false; }
}
return true;
}
}
function drawGrid()
{
for(var j=0;jhnum;j++)
for(var i=0;iwnum;i++)
{
if( grid[j][i]!=gridBuf[j][i])
{
paintCell(j,i,grid[j][i]);
}
gridBuf[j][i]=grid[j][i];
}
}
function paintCell(i,j,color)
{
var htmlGrid=document.getElementById("TetrisGrid").firstChild;
htmlGrid.childNodes[i].childNodes[j].style.backgroundColor=colors[color];
}
function init()
{
var html='table id="TetrisGrid" cellspacing=1 style="background-color:green"tbody';
for(var i=0;i=hnum;i++)
{
html+='tr';
for(var j=0;j=wnum;j++)
{
html+='td width="20" height="20" style="background-color:'+colors[grid[i][j]]+';"/td';
}
html+='/tr \r\n';
}
html+='/tbody/table';
document.write(html);
}
function checkLineFull()
{
var full,i,j,i2;
var y3=box.y+box.h;
var y4=box.y;
for(i=y3;i=y4;)
{
full=1;
for(j=0;jwnum;j++)
if(grid[i][j]==0){full=0; break;}
if(full==0){ --i; continue;}
for(i2=i; i20;i2--)
for(j=0;jwnum;j++)
grid[i2][j]=grid[i2-1][j];
drawGrid();
y4++;
gotLine++;
}
checkGameOver();
}
function checkGameOver()
{
var bOver=false;
for(var j=1;jwnum;j++)
if(grid[0][j]0){ bOver=true; break;}
if(!bOver){
box=new Box((wnum-1)/2,0,boxdata[Math.floor(Math.random()*7)],Math.floor(Math.random()*5)+1);
box.putNewBox();
}
else
{
bGameOver=true;
msg.innerHTML="游戲結(jié)束! 您的得分為"+gotLine*100;
window.clearTimeout(doing);
}
}
function document_onkeydown()
{
if(bGameOver) return;
switch(event.keyCode)
{
case 32:
down();
break;
case 37:
box.moveLeft();
break;
case 39:
box.moveRight();
break;
case 38:
box.rotate();
break;
case 40:
box.moveDown();
break;
case 80:
stop();
break;
case 66:
window.location.reload();
break;
case 67:
restart();
break;
}
}
function down(){
if(window.event.keyCode==32){
clearTimeout(doing);
for(i=0;ihnum;i++){
if(candown==0){
box.moveDown();
}else{
break;
}
}
candown=0;
doing=window.setTimeout('moveDownBox()',interval);
}
}
var interval;
function moveDownBox()
{
interval=1000-10*(gotLine80?80 :gotLine);
msg.innerHTML=" 等級:"+Math.floor(gotLine/10)+";得分:"+gotLine*100;
box.moveDown();
doing=window.setTimeout('moveDownBox()',interval);
}
function startGame()
{
init();
doing=window.setTimeout('moveDownBox()',1000);
bGameOver=false;
box=new Box((wnum-1)/2,0,boxdata[Math.floor(Math.random()*7)],Math.floor(Math.random()*5)+1);
box.putNewBox();
drawGrid();
}
var status;
function stop(){
status=1;
window.clearTimeout(doing);
}
function restart(){
if(status==1){
status=0;
doing=window.setTimeout('moveDownBox()',1000);
}
}
function keydown(){
if (document.all)document_onkeydown()
}
/script
BODY onLoad="window.focus()" onkeydown="keydown()"
table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"
tr
td
table id="maintable" border="0" align="center" cellpadding="0" cellspacing="0"
tr
td align="center"
span class="btn" style="width:100%; height:24px;background-color:#F0C0C0;color:#0000FF;vertical-align:middle;text-align:center"俄羅斯方塊/span/td
/tr
tr
td style="height:20px;background-color:black;color:#00FF00;font-size:12px;"table height="20" border="0" cellpadding="0" cellspacing="0"
tr style="font-size:12px; color:#FFFFFF"
td width="100%" a style="cursor:hand" onclick="window.location.reload()"開始(B)/a a style="cursor:hand" onclick="stop();"暫停(P)/a a style="cursor:hand" onclick="restart();"繼續(xù)(C)/a/td
/tr
/table/td
/tr
tr
td style="height:20px;background-color:black;color:#00FF00;font-size:12px;" id="msg" 等級:0;得分:0/td
/tr
tr
td height="20"
script language=javascript
maintable.style.width=(wnum+1)*20;
startGame();
/script
/td
/tr
/table/td
/tr
/table
/body
/html
那你起碼得搞個后臺 c# java 都是可以的,通過后臺進行寫數(shù)據(jù)到數(shù)據(jù)庫中就好了。
網(wǎng)頁名稱:包含俄羅斯方塊html5的詞條
瀏覽地址:http://chinadenli.net/article1/dsiggid.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動態(tài)網(wǎng)站、網(wǎng)頁設(shè)計公司、外貿(mào)建站、網(wǎng)站策劃、域名注冊、響應(yīng)式網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)