Jump to content

  • Log In with Google      Sign In   
  • Create Account

Yasaswi Srikanth

Member Since 28 Feb 2012
Offline Last Active Jun 09 2012 07:44 PM

Topics I've Started

Bloxorz game in OpenGL.

30 May 2012 - 08:00 AM

Hi friends,

I am trying to develop the Bloxorz game in OpenGL.
Please see this link http://www.albinoblacksheep.com/games/bloxorz

To do that I have draw the squares floor and a rectangle on top of it.
By I have trouble starting this. I mean I can't figure out how can I draw the floor like in 3d and a rectangular cube thing.

Please guide me.
I have googled this item , but haven't got anything.

How to move the bullet along with the ship

11 May 2012 - 05:27 AM

Hello,

I am making a galaxian game in sdl .

(For quick watch of galaxians who doesn't know it
http://www.1980-games.com/us/old-games/java-games/galaxian.php )

I have drawn the aliens ,ship and bullet . The ship is moving is moving left and right . The bullet is moving up for shooting the aliens.

I want to know how to make a new bullet appear after one is gone.
How to move the bullet along with the ship.
Also i didn't provide any kind of animation for the aliens .How to do it.

I didn't use any opengl purely sdl and c++.
If i use any opengl is there any benefit for me or I can go with sdl itself?


I don't know how to redraw the bullet.

Please see here this is my main.cpp that handles the key Events and drawing :


#include "SDLGameEngine/cGraphics.h"
#include "SDLGameEngine/Defines.h"
#include "SDLGameEngine/cInput.h"
#include "cGreenAlien.h"
#include "cShip.h"
#include "SDLGameEngine/Math.h"
#include "cBullet.h"


//collision detection with screen ends

bool shipCanMoveLeft();
bool shipCanMoveRight();

cShip ship;
cBullet bullet;

int main(int argc,char **argv)
{

cGraphics* graphics = new cGraphics(WINDOW_WIDTH,WINDOW_HEIGHT,"Galaxians Clone");

SDL_Surface* bitmap = graphics->LoadImage("Data/alien2.bmp");

cInput input = cInput();

//Green Alien
cGreenAlien greenalien1 = cGreenAlien(graphics,bitmap,100.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);

cGreenAlien greenalien2 = cGreenAlien(graphics,bitmap,140.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);

cGreenAlien greenalien3 = cGreenAlien(graphics,bitmap,180.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);

cGreenAlien greenalien4 = cGreenAlien(graphics,bitmap,220.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);

cGreenAlien greenalien5 = cGreenAlien(graphics,bitmap,260.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);

cGreenAlien greenalien6 = cGreenAlien(graphics,bitmap,300.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);


cGreenAlien greenalien7 = cGreenAlien(graphics,bitmap,340.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);

cGreenAlien greenalien8 = cGreenAlien(graphics,bitmap,380.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);

cGreenAlien greenalien9 = cGreenAlien(graphics,bitmap,420.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);

cGreenAlien greenalien10 = cGreenAlien(graphics,bitmap,460.0f,210.0f,5,9,28,
20,BIGBUG_SPEED);


ship = cShip(graphics,bitmap,SHIP_START_X,SHIP_START_Y,SHIP_IMG_X,SHIP_IMG_Y,SHIP_WIDTH,SHIP_HEIGHT,SHIP_SPEED);

bullet = cBullet(graphics,bitmap,BULLET_START_X,BULLET_START_Y,BULLET_IMG_X,BULLET_IMG_y,
BULLET_WIDTH,BULLET_HEIGHT,1.0f);



bool quit = false;

while(quit == false)
{

if(input.GetEvent())
{

if(input.IsQuit())
{
quit = true;
}

switch(input.GetKeyPressed())
{
case SDLK_ESCAPE:
{
quit = true;
}
break;

case SDLK_SPACE:
{

bullet.pushUp();


}
break;



}
}
if(input.KeyHeld(SDLK_LEFT))
{
if(shipCanMoveLeft())
{
ship.moveLeft();
}
}

if(input.KeyHeld(SDLK_RIGHT))
{
if(shipCanMoveRight())
{
ship.moveRight();
}
}






bullet.MoveVertical();



graphics->ClearScreen(0,0,0);

greenalien1.Draw();

greenalien2.Draw();

greenalien3.Draw();

greenalien4.Draw();

greenalien5.Draw();

greenalien6.Draw();

greenalien7.Draw();

greenalien8.Draw();

greenalien9.Draw();

greenalien10.Draw();

ship.Draw();

bullet.Draw();

graphics->Show();

}

graphics->CloseImage(bitmap);

delete graphics;

return 0;

}



//collision detction of ship with left screen
bool shipCanMoveLeft()
{
SDL_Rect rect = ship.AfterMoveLeft();

// check left extremity

if(rect.x < 0)
{
return false;
}


return true;

}


bool shipCanMoveRight()
{

SDL_Rect rect = ship.AfterMoveRight();


if((rect.x + SHIP_WIDTH) > WINDOW_WIDTH)
{
return false;
}

return true;
}

collision detection is not functioning

25 April 2012 - 05:53 AM

Hello,

I am a beginner in game programming in sdl.
I am following aaron cox's tutorial's at http://www.aaroncox.net/tutorials/

He has given an sdlGameEngine and using it he has explained how to deal with game basics.
Everything has worked fine but collision detection is not working.

I have included all the source code of the msvc project.
The controls to move bigbug are the arrow keys and to move the smallbug are asdw .
The bugs should stop while colliding with screen and rock.

Thanks in advance.

Error while building cocos2d-x

23 April 2012 - 09:58 PM

Hello i have downloaded cocos2d-1.0.1-x-0.12.0 and run build-win32.bat .
The build is not successful the tests.exe failed to run after building saying that
get data from file
Release.win32/images/close.png failed.

I didnot run install-templates-msvc.bat because it may cause any error .
please find a solution.
the console output while building second time :

/*
* Check VC++ environment...
*/

/*
* Building cocos2d-x library binary, please wait a while...
*/

Setting environment for using Microsoft Visual Studio 2008 x86 tools.
Microsoft ® Visual C++ Project Builder - Command Line Version 9.00.30729
Copyright © Microsoft Corporation. All rights reserved.

Build started: Project: libBox2D, Configuration: Debug|Win32
libBox2D - up-to-date
Build started: Project: libchipmunk, Configuration: Debug|Win32
libchipmunk - up-to-date
Build started: Project: libCocosDenshion, Configuration: Debug|Win32
libCocosDenshion - up-to-date
Build started: Project: libcocos2d, Configuration: Debug|Win32
libcocos2d - up-to-date
Build started: Project: liblua, Configuration: Debug|Win32
liblua - up-to-date
Build started: Project: HelloWorld, Configuration: Debug|Win32
HelloWorld - up-to-date
Build started: Project: tests, Configuration: Debug|Win32
tests - up-to-date
Build started: Project: HelloLua, Configuration: Debug|Win32
HelloLua - up-to-date
Build started: Project: libBox2D, Configuration: Release|Win32
libBox2D - up-to-date
Build started: Project: libchipmunk, Configuration: Release|Win32
libchipmunk - up-to-date
Build started: Project: libCocosDenshion, Configuration: Release|Win32
libCocosDenshion - up-to-date
Build started: Project: libcocos2d, Configuration: Release|Win32
libcocos2d - up-to-date
Build started: Project: liblua, Configuration: Release|Win32
liblua - up-to-date
Build started: Project: HelloWorld, Configuration: Release|Win32
HelloWorld - up-to-date
Build started: Project: tests, Configuration: Release|Win32
tests - up-to-date
Build started: Project: HelloLua, Configuration: Release|Win32
HelloLua - up-to-date

Build complete: 16 Projects succeeded, 0 Projects failed, 0 Projects skipped
/*
* Check the cocos2d-win32 application "tests.exe" ...
*/

/*
* Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual S
tudio User Guide.
*/

File not found - *.*
0 File(s) copied
File not found - *.*
0 File(s) copied
File not found - *.*
0 File(s) copied

How to start a career as a Game Programmer

19 April 2012 - 06:31 AM

Hello Gamedev.net ,

I am a 23 year old graduate in Information Technology from India.
I have recently started doing programming and I want to choose a career in computer games. so I have joined in a start up company with four members and learning programming and graphics on my own from ebooks and net tutorials.

Is the thing which I am doing is correct?
can anyone do this alone?
Because there are no trainers here I am alone learning the whole day searching over the internet for tutorials on programming.A group of three people who actually work in other companies come in the weekends and work in my company have worked a small letter project for children on IPAD that enables to learn the letter by tracing them. I am not into any project but he may put into after some days.Till now he said me practice some c++,data structures and opengl stuff.

waiting for your reply.

PARTNERS