Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

bigbadbear9885

Member Since 23 Nov 2010
Offline Last Active Feb 21 2013 11:45 PM
-----

Posts I've Made

In Topic: SDL how to move an object by holding a button rather then pressing the button...

07 December 2012 - 12:44 AM

(sigh) Now I'm hitting some more problems, things may be a little mixxed up. Now it won't move at all! It shows but doesn't respond in movement. Heres the code I wrote if you or anyone can see what I'm doing wrong

Attached File  ship.bmp   2.05K   24 downloads
#include "SDL.h"
int main(int argc, char *argv[])
{
bool bRun = true;
SDL_Surface *screen , *ship;
SDL_Rect shipRect;
shipRect.x = 100 ;
shipRect.y = 100 ;
	
SDL_WM_SetCaption("Fryday", NULL);
screen = SDL_SetVideoMode( 256 , 224 , 32 , SDL_DOUBLEBUF|SDL_HWSURFACE|SDL_ANYFORMAT);

SDL_FillRect(screen , NULL , 0x221122);
ship = SDL_LoadBMP("./ship.bmp");
SDL_SetColorKey( ship, SDL_SRCCOLORKEY, SDL_MapRGB(ship->format, 255, 0, 255) );
SDL_BlitSurface( ship , NULL , screen , &shipRect );
SDL_Flip(screen);
	 SDL_Event event;
  while(bRun) {
  bool keysHeld[323] = {false}; // everything will be initialized to false

if (SDL_PollEvent(&event))
	  {
		 if (event.type == SDL_QUIT)
		 {
		    bRun = false;
		 }
		 if (event.type == SDL_KEYDOWN)
		 {
		    keysHeld[event.key.keysym.sym] = true;
		 }
		 if (event.type == SDL_KEYUP)
		 {
		    keysHeld[event.key.keysym.sym] = false;
		 }

	  if ( keysHeld[SDLK_ESCAPE] )
	  {
		 bRun = false;
	  }
	  if ( keysHeld[SDLK_LEFT] )
	  {
		 shipRect.x -= 1;
	  }
	  if ( keysHeld[SDLK_RIGHT] )
	  {
		 shipRect.x += 1;
	  }
	  if ( keysHeld[SDLK_UP] )
	  {
		 shipRect.y -= 1;
	  }
	  if (keysHeld[SDLK_DOWN])
	  {
		 shipRect.y += 1;
	  }
}
    }; // while(bRun) { END
return 0;
}

In Topic: How were Commodore 64 games developed?

04 November 2012 - 05:55 PM

I mean just like how you can just start the C64 without anything, and just write basic code and compile it without any compiling software, could you do the same exact thing with assembly, just go write some assembly code without anything and assemble same, same exact thing or did you have to Have some assembling software?

In Topic: How were Commodore 64 games developed?

04 November 2012 - 05:22 PM

Can the C64 assemble by itself?

And so those Paint programs you listed could be used for the game graphics and sprites on the C64?

PARTNERS