• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

ironsam

Members
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

114 Neutral

About ironsam

  • Rank
    Newbie
  1. i need a snippet of code
  2. how do you input VK with two characters for example VK_LEFT_UP or something like that.
  3. I researched key states online and it looked like it would be most useful in that situation.[img]http://public.gamedev.net//public/style_emoticons/default/mellow.png[/img]
  4. This program is supposed to make a sonic sprite go left, right, up, down, and vertical but when i press the left to does no do anything then when i press right it does not go right but after i press them times ican go left and right then icant move until i press them again and it just repeats over and over. then when i press up it goes up it works but then if I press down it gose up and it just repeats and it just gose vertical at random i use an engine that i include that has a lot of files that it includes.[img]http://public.gamedev.net//public/style_emoticons/default/huh.png[/img] #include "..\Engine\Advanced2D.h" // using namespace Advanced2D; #define SCREENW 1024 #define SCREENH 768 #define OBJECT_SPRITE 60 #define OBJECT_BACKGROUND 1 #define MAX 1 Sprite *p; Texture *ball_image; Texture *sonic_run_left; Sprite *cursor; Sprite *sprite; Sample *music; float vy; float vx; bool game_preload() { g_engine->setAppTitle("INPUT DEMO"); g_engine->setFullscreen(false); g_engine->setScreenWidth(1024); g_engine->setScreenHeight(739); g_engine->setColorDepth(32); return 1; } bool game_init(HWND) { //load background image Sprite *background = new Sprite(); if (!background->loadImage("arz1.png")) { g_engine->message("Error loading craters.tga"); return false; } background->setObjectType(OBJECT_BACKGROUND); background->setCollidable(false); g_engine->addEntity(background); p = new Sprite(); p->loadImage("sonic_run_forward.png"); p->setDirection(0); p->setScale(1.5f); //load cursor cursor = new Sprite(); cursor->loadImage("particle16.tga"); //load asteroid image sonic_run_left = new Texture(); if (!sonic_run_left->Load("sonic_run_left.png")) { return false; } ball_image = new Texture(); if (!ball_image->Load("lightningball.tga")) { //g_engine->message("Error loading lightningball.tga"); return false; } //create sprites for (int n=0; n < MAX; n++) { //create a new sprite sprite = new Sprite(); sprite->setObjectType(OBJECT_SPRITE); sprite->setImage(ball_image); sprite->setSize(40,40); sprite->setScale( 2.0 ); sprite->setPosition((SCREENW/2) , (SCREENH/2)-10 ); //add sprite to the entity manager g_engine->addEntity(sprite); } //load independent sample music = new Sample(); music = g_engine->audio->Load("arz.mp3"); if (!music) { g_engine->message("Error loading wobble.wav"); return false; } //play music g_engine->audio->Play(music); return true; } void game_update() { } void game_keyPress(int key) { /*if(GetKeyState(VK_RIGHT)) { sprite->setVelocity( -6.0, 6.0 ); }*/ //set velocity /* switch (key) { */ //case DIK_DOWN: if(GetKeyState(VK_DOWN)) { //vx = spr->getVelocity().getX(); //double vy = spr->getVelocity().getY(); //vx = 0; vy = 2.0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(8); sprite->setColumns(8); sprite->setSize(40,40); sprite->setFrameTimer(40); Sleep(1); //break; } if(GetKeyState(VK_UP)) { //case DIK_UP: //vx = 0; vy = -2.0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(8); sprite->setColumns(8); sprite->setSize(40,40); sprite->setFrameTimer(40); Sleep(1); //break; } if(GetKeyState(VK_RIGHT)== 1) { //case DIK_LEFT: sprite->setImage(sonic_run_left); vx = -2.0; //vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(8); sprite->setColumns(8); sprite->setSize(40,40); sprite->setFrameTimer(40); //break; } if(GetKeyState(VK_LEFT)== 1) { //case DIK_RIGHT: sprite->setImage(ball_image); vx = 2.0; //vy = 0; sprite->setVelocity( vx, vy); sprite->setTotalFrames(8); sprite->setColumns(8); sprite->setSize(40,40); sprite->setFrameTimer(40); //break; } } //key press void game_keyRelease(int key) { /* switch (key) { case DIK_DOWN: //vx = 0; vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(1); break; case DIK_UP: //vx = 0; vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(1); break; case DIK_LEFT: vx = 0; //vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(1); break; case DIK_RIGHT: vx = 0; //vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(1); break; } //switch */ if(GetKeyState(VK_UP)) { //case DIK_LEFT: sprite->setImage(sonic_run_left); vx = 0.0; vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(1); sprite->setColumns(1); sprite->setSize(40,40); sprite->setFrameTimer(0); //break; //Sleep(150); } if(GetKeyState(VK_DOWN)) { //case DIK_LEFT: sprite->setImage(sonic_run_left); vx = 0.0; vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(1); sprite->setColumns(1); sprite->setSize(40,40); sprite->setFrameTimer(0); //break; //Sleep(150); } if(GetKeyState(VK_RIGHT)) { //case DIK_LEFT: sprite->setImage(sonic_run_left); vx = 0.0; //vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(1); sprite->setColumns(1); sprite->setSize(40,40); sprite->setFrameTimer(0); //break; //Sleep(150); } if(GetKeyState(VK_LEFT)) { //case DIK_RIGHT: sprite->setImage(ball_image); vx = 0.0; //vy = 0; sprite->setVelocity( vx, vy ); sprite->setTotalFrames(1); sprite->setColumns(1); sprite->setSize(40,40); sprite->setFrameTimer(0); //break; } if (key == DIK_ESCAPE) g_engine->Close(); } void game_mouseButton(int button) { switch(button) { case 0: //button 1 break; } } void game_mouseMotion(int x,int y) { } void game_mouseMove(int x,int y) { float fx = (float)x; float fy = (float)y; } void game_mouseWheel(int wheel) { } void game_render3d() { g_engine->ClearScene(D3DCOLOR_XRGB(0,0,0)); } void game_render2d() { g_engine->SetIdentity(); } void game_end() { delete p; delete ball_image; delete cursor; } void game_entityUpdate(Advanced2D::Entity* entity) { switch(entity->getObjectType()) { case OBJECT_SPRITE: Sprite* spr = (Sprite*)entity; double w = (double)spr->getWidth() * spr->getScale(); double h = (double)spr->getHeight() * spr->getScale(); double vx = spr->getVelocity().getX(); double vy = spr->getVelocity().getY(); if (spr->getX() < 0) { spr->setX(0); //vx = fabs(vx); } else if (spr->getX() > SCREENW-w) { spr->setX(SCREENW-w); //vx = fabs(vx) * -1; } if (spr->getY() < 0) { spr->setY(0); //vy = fabs(vy); } //set floor// else if (spr->getY() > ((SCREENH)/2)-10) { spr->setY(((SCREENH)/2)-10); //vy = fabs(vy) * -1; } //spr->setVelocity(vx,vy); break; } } void game_entityCollision(Advanced2D::Entity* entity1,Advanced2D::Entity* entity2){} void game_entityRender(Advanced2D::Entity* entity) { }