问题标签 [gamecanvas]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
166 浏览

blackberry - J2me GameCanvas 上的黑莓广告

我想在我的GameCanvas. 但我们只能在 Blackberry 上展示 Blackberry 广告MainScreen。有什么办法可以在上面展示广告GameCanvas吗?

0 投票
2 回答
1071 浏览

java - Java2 ME:keyPressed() 在 GameCanvas 中不起作用

我知道 J2ME 已经过时了,但我必须为作业做这件事。目前,我正在使用 GameCanvas 类,我的游戏是一个线程,所以我的代码看起来像这样..

可悲的是,keyPressed无论我的垃圾邮件在模拟器的数字键盘上多么难受,该方法都不会被调用。我知道有这个getKeyStates()方法GameCanvas,但我不想使用它,因为我不仅要捕获游戏键,还要捕获数字键 1~9。

有谁知道为什么我的代码没有进入我的keyPressed()方法,以及我能做些什么?非常感谢。


不知道我哪里出错了……但是在这里和那里进行了一些调整之后,它开始工作得很好。非常感谢你们!:)

0 投票
1 回答
599 浏览

actionscript-3 - AS3 change stage size - virtual camera

Edit: Is there any way to adjust the stage size and position from inside flash?

Hey Im making a flashgame right now, its a 2D game with 2charakters. You can move them right now trought the level as you want to, but my problem is, its only one fourth of the whole level displayed, so I thought about making a camera that moves along with the player.

Ussualy I would put all the level content into a container and move the container, but my problem is, that I have 2charakters which can move and the camera has to focus on both of them otherwise the second player cant see what he is doing. So I thought about scaling the background and the characters up at the same time to create a zoom in zoom out effect depending on the distance between the players, but scaling the charakters up is pretty complicated because the charakter does not only consists out of one movieclip.

0 投票
1 回答
632 浏览

graphics - Java ME 在 GameCanvas 上绘制多个动态精灵

我想在 GameCanvas 上绘制多个动态 Sprite,例如枪声。

我有两个主要课程:GameCanvasGameController

GameController持有我的枪击的矢量。

GameCanvas 可以访问GameControllerSprite 的 Vector,它还有一个render()在屏幕上绘制 Sprite 的方法。

LayerManager 包含我要绘制的所有 Sprite。

如何GameController在屏幕上的 Vector 中绘制所有对象?

0 投票
2 回答
1155 浏览

javascript - Canvas games - is it worth learning?

I am very into creating a canvas game, but im not sure if its worth the effort, and this is why...

Flash has Adobe Flash which is an interface for creating very complex animations, games and apps. So im sure that a program is soon to come where, making games and animation will not require anny coding skills, it will al be done via a graphical user interface, pushing buttons and such. So i am afraid i will put all this time into something that evantually will not be even necesary to achive the same goal.

What do you people think?

0 投票
2 回答
711 浏览

javascript - JS Canvas 游戏使用按键事件来修改按住 shift 按钮时的速度

我正在学习如何通过 JavaScript 使用画布制作游戏,并且我设置了箭头键来移动画布上的块。我想添加一个修饰符,在该修饰符中,按住 shift 键时,块移动的速度是原来的两倍,当按下 shift 键时,我的功能无法正常工作。

任何建议/帮助将不胜感激!

0 投票
1 回答
77 浏览

javascript - 向左或向右看时,如何使子弹不随角色移动?

我遇到了一个问题,当我向左或向右射击时,一旦我移动角色,子弹方向就会改变,而它仍然射击。我正在使用主角图片作为向左或向右射击的条件,但我希望子弹继续朝射击方向射击,即使我改变角色的运动

我是 Javascript 的初学者,我正在使用画布为大学项目创建游戏。

完整代码