geschwindigkeits probleme..
Übersicht

![]() |
HackerBoyZBetreff: geschwindigkeits probleme.. |
![]() Antworten mit Zitat ![]() |
---|---|---|
hallöchen, ich habe eine "ditor" für mein jump'n'run spiel gemacht.
allerdings habe ich EXTREME fps probleme wenn ich : Code: [AUSKLAPPEN] If MouseDown(1) And layer = 0 Then back_map[mx,my] = 1 If MouseDown(1) And layer = 1 Then play_map[mx,my] = 1 If MouseDown(1) And layer = 2 Then front_map[mx,my] = 1 hinzufüge. hier der ganze code: Code: [AUSKLAPPEN] AppTitle $="Editor BETA" Graphics 800,600 Global tileset = LoadAnimImage("gfx/grass.png",32,32,0,8) Global cursor = LoadAnimImage("gfx/cursor.png",32,32,0,4) Global back_map%[300,100] Global play_map%[300,100] Global front_map%[300,100] Global draw_frame% Global mx% Global my% Global Layer% = 1 Const data_ending$ = ".map" Function init_map(x%,y%,value%) For a = 0 To x For b = 0 To y back_map[a,b] = value% play_map[a,b] = value% front_map[a,b] = value% Next Next EndFunction Function draw_map(x%,y%) mx = MouseX()/32 my = MouseY()/32 For a = 0 To x For b = 0 To y If MouseDown(1) And layer = 0 Then back_map[mx,my] = 1 If MouseDown(1) And layer = 1 Then play_map[mx,my] = 1 If MouseDown(1) And layer = 2 Then front_map[mx,my] = 1 If back_map[a,b] > -1 Then DrawImage tileset,a*32,b*32,back_map[a,b] If play_map[a,b] > -1 Then DrawImage tileset,a*32,b*32,play_map[a,b] If front_map[a,b] > -1 Then DrawImage tileset,a*32,b*32,front_map[a,b] Next Next EndFunction Function draw_mouse(tile%) layer = MouseZ() DrawImage cursor,mx*32,my*32,tile DrawImage cursor,MouseX(),MouseY(),0 EndFunction '--------- 'MAIN LOOP '--------- init_map(30,30,-1) Repeat draw_map(30,30) draw_mouse(1) Flip ; Cls Until AppTerminate() ist das normal? was kann ich machen? Danke. EDIT: Ok is jetzt irgendwie ganz von alleine normal geworden.. danke |
||
![]() |
mahe |
![]() Antworten mit Zitat ![]() |
---|---|---|
MouseDown(1) solltest Du nicht ständig abfragen.
Entweder Du speicherst den Rückgabewert in einer Variable oder verschachtelst die If-Anweisungen so dass es nur noch einmal abgefragt wird. |
||
ʇɹǝıdɯnɹɹoʞ ɹnʇɐuƃıs - ǝpoɥʇǝɯ-ɹoɹɹıɯ ɹǝp uı ,ɹoɹɹǝ, |
![]() |
HackerBoyZBetreff: thx |
![]() Antworten mit Zitat ![]() |
---|---|---|
ohh ja danke... ganz übersehen^^ | ||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group