• entries
108
319
• views
137769

# Lucid.EasyToUse++

100 views

I just reworked some of the base functions to Lucid to make it easier to use. Someone asked how to move a image around with the mouse so I took the challenge and did it up: Download "You Gotta Move It". You just move the image around by dragging the mouse, so I don't really see the point in why I uploaded it... Ah well.

The source was very easy to write up using Lucid. Took about three minutes to write and (in my opinion) is very easy to understand:

#include "lucid/base.h"  // Include Lucid// Setup the main game stateclass MainGameState : public System::State{private:	System::Graphics::Sprite YouGottaMoveIt;	bool MovingIt;public:	void Enter(){		YouGottaMoveIt.Load("test.bmp");		YouGottaMoveIt.TransColour(255,0,255);	}	void Draw(){		YouGottaMoveIt.Draw();	}	void Update(){		if(MovingIt){			YouGottaMoveIt.x(System::Input::MouseX());			YouGottaMoveIt.y(System::Input::MouseY());		}	}	void KeyDown(int value){		switch(value){		case SDLK_ESCAPE:			System::Going = false;			break;		}	}	void MouseButtonDown(int button){		if(button == SDL_BUTTON_LEFT){			if(System::Input::MouseInBounds(&YouGottaMoveIt)){				MovingIt = true;			} 		}	}	void MouseButtonUp(int button){		if(button == SDL_BUTTON_LEFT){			MovingIt = false;		}	}}GameState;int main(int argc, char *argv[]){	System::Initialize(400,300,false,&GameState,60,"You Gotta Move It");	System::MainLoop();		return 0;}

If you don't understand that source, I'll have to slap you. I don't know where I'm going with Lucid. I should be doing things with Ogre, Direct3D and OpenGL. Maybe I'll just recreate a bunch of classics and then move on. Could continue work on that asteroids clone.

### Random Interest

Ummmmm..... Yeah.

Quote:
 Could continue work on that asteroids clone.
You should definitely finish that one!

Yes, you NEED to finish asteroids before you move on. Please don't develop the same pattern as we all do and stop halfway through a project to work on something better... You'll never get anything done [sad]

## Create an account

Register a new account