Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

113 Neutral

About JohnnyBoy53

  • Rank
  1. I was planning on studying some game code from some open source games but I can't seem to find any that uses DirectX. The ones i found are mostly using Opengl with SDL. I am looking for a 2D platformer to study before i try and start a project on my own to become familiar with the code. I was planning on learning Opengl, but i am just learning DirectX and feel that i need to get more projects under my belt to become comfortable with it before moving on to either Opengl or C#. If anyone can point me in the direction or just name off the top which open source Direct X9 games are available, i would be thankful. Thanks!
  2. JohnnyBoy53

    Regarding what library/langauge to use

    Wow, as i was reading this, I kept thinking "Is this guy me?!" I too am just starting to develop very basic games(I dont know if you can even call them games yet,) with sprite animation and collision detection. I spent all my first and half of my second year programming in college thinking "When am I going to be able to see stuff on the screen other than a command line?? Seeing sprites being animated by my c++ code was such a wonderful feeling. I also think that I am still learning the true object oriented approach and writing half breed programs. I plan to study up on it more before tackling my next game project. I will learn C# next after I get more comfortable creating real games with Direct X, and learning HTML/CSS/Javascript/PHP. I have a bunch of free time as I am only taking 1 class next semester and 1 other class the semester after before receiving my A.S in CS and transferring.
  3. i am guessing "putting java to work" is intro to java programming, then object oriented programming would be development with objects. That is all you really need to have a basic understanding of the java language. From there, you will probably choose a graphic API to work with. You will be using the functions the API provides. With the understanding of the language, you should be able to look at the code and understand how each function works.
  4. JohnnyBoy53

    How to code bullets in side scroller

    Yes I have already tried that but ended up removing it as it did not work. I am now able to have the bullet sprite start where the ship is. The only problem is that the bullet sprite does not accelerate forward (most likely logic errors with bullet position being initialized to player ship position). It just appears in front of the ship. I have updated it to this. [source lang="cpp"]if (Key_Down(DIK_SPACE)){ bullet1.posX= player.posX; bullet1.posY= player.posY; //initialize bullet position to the current position of the ship Sprite_Draw_Frame(playerShip,bullet1.bulletMovementFoward(),bullet1.posY,frame,100,100,2); }[/source] Thank you for your input Neo, only problem i have now is making the bullet sprite accelerate forward.
  5. So i have an R-type like game where the player controls the ship with WASD and shoots with spacebar. I am kind of stuck on how to implement the bullets though. I want the bullet to have the starting point of the current position of the player spaceship. How would the bullet objects work? If spacebar is pressed, would it create a bullet object and be destroyed if it came in contact with an alien ship or is off the screen? How would each bullet object differ from the previous bullets? [source lang="cpp"]struct pShip { float posX; float posY; pShip(float x=0,float y=400) { posX = x; posY = y; } float playerMovementForward(void) { posX += .3; return posX; }; float playerMovementBack(void) { posX -=.3; return posX; }; float playerMovementUp(void) { posY -=.3; return posY; }; float playerMovementDown(void) { posY +=.3; return posY; }; }; //Create PlayerShip object pShip player; float bulletX = player.posX; float bulletY = player.posY; //Create bullet logic struct Bullets { float posX; float posY; Bullets(float x = bulletX, float y = bulletY) { posX = x; posY = y; }; //Fire, return x position of bullet }; ////////////////////////////////////////////////////////////////////////////////////////////////// // GAME LOGIC // //Player Controls if (Key_Down(DIK_D) && player.posX < SCREENW - 100) { Sprite_Draw_Frame(playerShip,player.playerMovementForward(),player.posY,1,100,100,2); } if (Key_Down(DIK_A) && player.posX > 5) { Sprite_Draw_Frame(playerShip,player.playerMovementBack(),player.posY,frame,100,100,2); } if (Key_Down(DIK_W) && player.posY > 10 ){ Sprite_Draw_Frame(playerShip,player.posX,player.playerMovementUp(),frame,100,100,2); } if (Key_Down(DIK_S) && player.posY < SCREENH - 50){ Sprite_Draw_Frame(playerShip,player.posX,player.playerMovementDown(),frame,100,100,2); } //Firing bullets Bullets bullet1; if (Key_Down(DIK_SPACE)){ Sprite_Draw_Frame(bullet,bullet1.posX,bullet1.posY,frame,100,100,2); } ////////////////////////////////////////////////////////////////////////////////////////////////// [/source] I only posted the relevant structures and functions, but when i press space bar, the bullet just appears where the ORIGINAL starting of the spaceship was (before moving the player ship), and it does not move. I've been messing around with it all day but can not find the solution. Thanks in advance.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!