5864 Shares

Does anyone know how to program a game?

Does anyone know how to program a game? Topic: How to write a javascript program in html
July 20, 2019 / By Deena
Question: I have a few ideas for a game, and I have very little knowledge of coding. So I want to start out trying to make it kinda like the Legend of Zelda on the NES.So does anyone know where I can find any info, or tutorials? I tried looking all over in Google, but cant find much. I have eclipse, as the place where I'm gonna write and script the code, if that helps.... I'm using paint.net and paint on windows 7 to make the graphics, so...Yeah, thanks! :D I will also need a good engine to run it on, and I was planning to code the game in java script.
Best Answer

Best Answers: Does anyone know how to program a game?

Brogan Brogan | 8 days ago
You would need something better than JavaScript to program a game, JavaScript requires HTML and CSS to work effectively and isn't really a tool for games development. Legend of Zelda is not a simple game just because it has simple graphics, thats not to say it's ultra complex, it's just not simple. You should look at Game Maker as a starting point for building games, you could also investigate Unity3d or Adobe Flash. See my article at http://www.cortex.tk/?p=549 which is a basic guide to creating a game from an idea. It's not impossible to create a game but it does take a lot of time and patients.
👍 244 | 👎 8
Did you like the answer? Does anyone know how to program a game? Share with your friends

We found more questions related to the topic: How to write a javascript program in html


Brogan Originally Answered: Can some one help me with a guessing game program for C++?
You need to do the psuedocode is what you're saying This is how to tell them to write the program. set guess equal to 11 set a count to 0 generate a number "num" between 1 and 10 using a random number generator Greet the user While the guess is not true AND count is less than 3 increment count ask the user for a guess if guess doesn't equal num output that the user got it wrong end loop if guess equals num output that the user got the guess correct in count tries else output that the user did not guess correctly.
Brogan Originally Answered: Can some one help me with a guessing game program for C++?
Search for the 'Random number generator in C++' code in Google and suppose u store the random number in a variable num. Since number has to be between 1 and 10, do n=num%11 , num= num/10 (But it actually gives the number between 0 to 10, so repeat n=num%11 and num=num/10 until n != 0). Then ur new random number variable is n. Rest of the code is simple if, then else conditions, and hope you can manage it on ur own. Good Luck.

Alison Alison
http://lazyfoo.net/SDL_tutorials/index.php A great place for beginners to start out with game programming, but it requires basic knowledge in C++ programming.
👍 100 | 👎 4

Alison Originally Answered: I'm looking for X-O game Code C++ (program).?
Mr stiffmeister; thanks for the code. how can i modify it in XCode to become an iPhone application? thx in advance!
Alison Originally Answered: I'm looking for X-O game Code C++ (program).?
include BITMAP *xSprite; BITMAP *oSprite; int board[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; //This will be used to keep //track of the Xs and Os int curSquare = 0; //This will keep track of the current square //the selector is on int turn = 1; //This will keep track of whose turn it is //1 Will be for X and 2 for O int x = 0; //X and Y position of selector int y = 0; int tempX = 0; //holds temporary values used to clear selector int tempY = 0; void setupBoard(){ //This function will draw in the grid acquire_screen(); line( screen, 200, 0, 200, 480, makecol( 255, 255, 255)); line( screen, 400, 0, 400, 480, makecol( 255, 255, 255)); line( screen, 0, 150, 680, 150, makecol( 255, 255, 255)); line( screen, 0, 300, 680, 300, makecol( 255, 255, 255)); rect( screen, x+1, y+1, x + 199, y + 149, makecol( 255, 255, 0)); release_screen(); } void updateBoard(){ //draws in selector rect( screen, tempX+1, tempY+1, tempX + 199, tempY + 149, makecol( 0, 0, 0)); rect( screen, x+1, y+1, x + 199, y + 149, makecol( 255, 255, 0)); rest(100); } void announceWinner(){ //Announces the winner if( turn == 1){ textout_ex( screen, font, "X Wins!!!!", 300, 240, makecol( 255, 0, 0), makecol(0, 0, 0)); } else { textout_ex( screen, font, "O Wins!!!!", 300, 240, makecol( 255, 0, 0), makecol(0, 0, 0)); } } void checkWin(){ //checks for a winner if( board[0] == turn && board[1] == turn && board[2] == turn){ announceWinner(); } else if( board[0] == turn && board[3] == turn && board[6] == turn){ announceWinner(); } else if( board[0] == turn && board[4] == turn && board[8] == turn){ announceWinner(); } else if( board[1] == turn && board[4] == turn && board[7] == turn){ announceWinner(); } else if( board[2] == turn && board[4] == turn && board[6] == turn){ announceWinner(); } else if( board[2] == turn && board[5] == turn && board[8] == turn){ announceWinner(); } else if( board[3] == turn && board[4] == turn && board[5] == turn){ announceWinner(); } else if( board[6] == turn && board[7] == turn && board[8] == turn){ announceWinner(); } } void drawXO(){ //draws in the X and O acquire_screen(); if(turn == 1){ draw_sprite( screen, xSprite, x, y); board[curSquare] = 1; checkWin(); ++turn; } else if( turn == 2){ draw_sprite( screen, oSprite, x, y); board[curSquare] = 2; checkWin(); --turn; } release_screen(); rest(100); } void moveBox(){ //takes input clear_keybuf(); tempX = x; tempY = y; if( key[KEY_UP] && y != 0){ y -= 150; curSquare -=3; updateBoard(); } else if( key[KEY_DOWN] && y != 300){ y += 150; curSquare +=3; updateBoard(); } else if( key[KEY_RIGHT] && x != 400){ x += 200; ++curSquare; updateBoard(); } else if( key[KEY_LEFT] && x != 0){ x -= 200; --curSquare; updateBoard(); } else if( key[KEY_ENTER] && board[curSquare] == 0){ drawXO(); } } int main(){ allegro_init(); install_keyboard(); set_color_depth(16); set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0); xSprite = load_bitmap( "x.bmp", NULL); oSprite = load_bitmap( "o.bmp", NULL); setupBoard(); while( !key[KEY_ESC]){ moveBox(); } destroy_bitmap( xSprite); destroy_bitmap( oSprite); return 0; } END_OF_MAIN();

If you have your own answer to the question how to write a javascript program in html, then you can write your own version, using the form below for an extended answer.