Hot answers tagged javascript
9
Yes. There are many ways to wrap an HTML5 game for distribution on iOS. Solutions include CocoonJS, Game Closure, PhoneGap, and Ejecta.
Examples of HTML5 games on iOS include Onslaught! on iPad and Biolab Disaster on iPhone.
6
Before I answer the question you already asked, some notes:
You can use A* with the original grid system you are using. The key things you need are neighbors and distance (for the heuristic). For neighbors with your grid system, you need to do something different for even and odd columns (as you mention); here's how:
neighbors = [
[ [+1, +1], [+1, ...
2
There are two possible ways to do this.
The "fast" hack is to call your game's html page from an iframe. This is not recommended because of the iframe implications and cross-browser differences regarding attributes and, more important, you will not be able to capture input from keyboard.
The best way is to create the div and give it the id 'enchant-stage'. ...
2
I have not seen any games that do this, but I can think of a few ways to achieve this. Keep in mind that any solution will be browser and OS dependent, so you must offer alternative ways to start your game.
In general, my approach would consist of running your game's executable file from the browser. Here are some ideas I just made out. I'm not really sure ...
1
Consider this:
public sealed partial class HexCoords {
static HexCoords() {
MatrixUserToCanon = new IntMatrix2D(2, 1, 0,2, 0,0, 2);
MatrixCanonToUser = new IntMatrix2D(2,-1, 0,2, 0,1, 2);
}
protected HexCoords(CoordsType coordsType, IntVector2D vector) {
switch(coordsType) {
default:
case CoordsType.Canon: _vectorCanon ...
1
First, you shouldn't be hard-coding numbers like your acceleration. Numbers like these, which need to be fine tuned, should be variables that can be easily tweaked, either in one-place or dynamically using a slider or somesuch during testing.
Second, from what I understand (of your comment to MagiSun), your problem with the acceleration giving you odd ...
1
In regards to this comment by OP:
The problem is the resulting behavior, where the object continues to
move up for example, even if the down key is pressed. It eventually
changes direction but by then it's at nearly uncontrollable speeds.
That is how velocity and acceleration work. You are simply providing the user with acceleration increments that ...
1
It's possible that there's a bug in your delta time calculation or a bug in your calculations for entity movement. It's hard to say without seeing more code, but I don't think you need to divide the delta time by 1000. That value should already be in milliseconds. Your movement code should then multiply the entity's speed per millisecond by the number of ...
Only top voted, non community-wiki answers of a minimum length are eligible
