如果我的代码看起来像这样,我可以添加多个矩形吗? [英] Ho do I add multiple rectangles if my code looks like this?
问题描述
< canvas id =ctxwidth =1500height =725style =border:1px solid#000000;>
< br $>
var ctx = document.getElementById(ctx)。getContext(2d);
var player_name ='P'
var player_Lhand ='L'
var player_Rhand ='R'
var rightPressed = false;
var leftPressed = false;
var upPressed = false;
var downPressed = false;
//播放器--- -------------------------------------------------- ------------------------- \
ctx.fillRect(600,262.5,150,100)
cxt.fillRect(600,262.5,7.5,7.5)
// player ---------------------------- -------------------------------------------------- /
< b>我尝试了什么:< / b>
我只是穿上我不知道该怎么办。
----------------------------------- ----------------------------------------------
你问题的解决方案似乎很明显 - 考虑到你所展示的完成状态:
全部解释 此处 [ ^ ]。
在研究了一下之后,可能您决定的相关材料是相关的,也许然后再回复给我们。 。 。结果
<canvas id="ctx" width="1500" height="725" style="border:1px solid #000000;">
var ctx = document.getElementById("ctx").getContext("2d");
var player_name = 'P'
var player_Lhand = 'L'
var player_Rhand = 'R'
var rightPressed = false;
var leftPressed = false;
var upPressed = false;
var downPressed = false;
//player------------------------------------------------------------------------------\
ctx.fillRect(600,262.5,150,100)
cxt.fillRect(600,262.5,7.5,7.5)
//player------------------------------------------------------------------------------/
<b>What I have tried:</b>
I just don't know what to do.
---------------------------------------------------------------------------------
The solution to your question seems obvious - considering the state of completion you have shown:
It's all explained here[^].
After studying that little bit, and possibly related material you decide is relevant, perhaps then get back to us . . .
这篇关于如果我的代码看起来像这样,我可以添加多个矩形吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!