Click here to Skip to main content
16,005,222 members
Home / Discussions / C#
   

C#

 
QuestionPorting this to event-based? Pin
Lord Kixdemp24-Sep-06 12:31
Lord Kixdemp24-Sep-06 12:31 
AnswerRe: Porting this to event-based? Pin
Nader Elshehabi24-Sep-06 12:44
Nader Elshehabi24-Sep-06 12:44 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp24-Sep-06 14:27
Lord Kixdemp24-Sep-06 14:27 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi24-Sep-06 14:54
Nader Elshehabi24-Sep-06 14:54 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp24-Sep-06 15:13
Lord Kixdemp24-Sep-06 15:13 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi24-Sep-06 15:30
Nader Elshehabi24-Sep-06 15:30 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp25-Sep-06 11:25
Lord Kixdemp25-Sep-06 11:25 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi25-Sep-06 11:44
Nader Elshehabi25-Sep-06 11:44 
So I guess that when the user presses a key, there is an SDL event that will be fired? Well, I still don't see aproblem:
1- Make a thread fro the game loop
2- Make flags for each Key to be pressed
3- Raise that flag in the KeyDown, and make it false in KeyUp events -whether windows or SDL events-
4- On each loop render the game accordingly -change the position of the spirit if the key is pressed otherwise stay on course for example-
5- You will still be able to control the speed of excution in the thread by many ways includeing the Thread.Sleep() and specify the interval of sleep based on the speed of excution -you can get the speed of excution by many ways like Timers-.

I hope that was what you were looking for, but somehow i think you already did all this. Where is your problem?

RegardsRose | [Rose]

GeneralRe: Porting this to event-based? Pin
Lord Kixdemp25-Sep-06 14:27
Lord Kixdemp25-Sep-06 14:27 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi25-Sep-06 14:36
Nader Elshehabi25-Sep-06 14:36 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp25-Sep-06 15:02
Lord Kixdemp25-Sep-06 15:02 
GeneralRe: Porting this to event-based? Pin
Nader Elshehabi25-Sep-06 15:31
Nader Elshehabi25-Sep-06 15:31 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp26-Sep-06 14:55
Lord Kixdemp26-Sep-06 14:55 
AnswerRe: Porting this to event-based? Pin
Christian Graus24-Sep-06 15:12
protectorChristian Graus24-Sep-06 15:12 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp24-Sep-06 15:17
Lord Kixdemp24-Sep-06 15:17 
GeneralRe: Porting this to event-based? Pin
Christian Graus24-Sep-06 15:29
protectorChristian Graus24-Sep-06 15:29 
GeneralRe: Porting this to event-based? Pin
Lord Kixdemp25-Sep-06 8:14
Lord Kixdemp25-Sep-06 8:14 
Questionadd column to dataset Pin
Mohammed Elkholy24-Sep-06 10:39
Mohammed Elkholy24-Sep-06 10:39 
AnswerRe: add column to dataset Pin
Nader Elshehabi24-Sep-06 12:08
Nader Elshehabi24-Sep-06 12:08 
Question[Message Deleted] Pin
code_wiz24-Sep-06 8:06
code_wiz24-Sep-06 8:06 
AnswerRe: extracting a message value from LParam in Message in WndProc(...) Pin
Christian Graus24-Sep-06 11:58
protectorChristian Graus24-Sep-06 11:58 
QuestionRe: extracting a message value from LParam in Message in WndProc(...) Pin
Nader Elshehabi24-Sep-06 12:04
Nader Elshehabi24-Sep-06 12:04 
QuestionProblem getting serial port to open Pin
NYTSX24-Sep-06 7:50
NYTSX24-Sep-06 7:50 
AnswerRe: Problem getting serial port to open Pin
Ed.Poore24-Sep-06 8:23
Ed.Poore24-Sep-06 8:23 
GeneralRe: Problem getting serial port to open Pin
NYTSX25-Sep-06 0:59
NYTSX25-Sep-06 0:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.