Warum kommt bei mir: 'Function' can only appear in main prog
Übersicht

HendyBetreff: Warum kommt bei mir: 'Function' can only appear in main prog |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Tjap, wie gesagt warum: Warum kommt bei mir: 'Function' can only appear in main programm
Code: [AUSKLAPPEN] Graphics 1024,768,16,1 SetBuffer BackBuffer() Global geschwindigkeit# Global x#=300,y#=300 Global winkel# ;Spieler in allen winkeln speichern Dim player(359) TFormFilter 0 For winkel# = 0 To 359 Text 512,384,Int(winkel#/3.6)+" %" player(winkel#)=LoadImage("player.bmp") RotateImage player(winkel#),winkel# ;-----------------------------HAUPTSCHLEIFE-des-Spiels--------------------- ;.............................:::::::::::::................................ While Not KeyHit(1) Geschwindigkeit() Malen() fps# = (fps*19+1000/(MilliSecs()-ms))/20 ms = MilliSecs() Text 500,0,Int(fps#)+" FPS" Text 500,10,Int(x#)+" X" Text 500,20,Int(y#)+" Y" Text 0,0,Int (geschwindigkeit)+" Geschwindigkeit" Flip Cls Wend End ;------------------------------------------Funktionen------------------------------------------------- ;..........................................::::::::::................................................. Function Geschwindigkeit() If KeyDown(203) Then winkel#=winkel#-geschwindigkeit/3 If KeyDown(205) Then winkel#=winkel#+geschwindigkeit/3 If KeyDown(200) Then geschwindigkeit=geschwindigkeit+.3 If KeyDown(208) Then geschwindigkeit=geschwindigkeit-.1 geschwindigkeit=geschwindigkeit*.99 x=x + Cos(Winkel#)*geschwindigkeit y=y + Sin(Winkel#)*geschwindigkeit If geschwindigkeit> 10 Then geschwindigkeit= 10 If geschwindigkeit< -5 Then geschwindigkeit= -5 Text 0,0,Int (geschwindigkeit) End Function Function Malen() If winkel# > 359 Then winkel# = 0 If winkel# < 0 Then winkel# = 359 If x > 1023 Then x= 1023 If x < 1 Then x = 1 If y > 767 Then y = 767 If y < 1 Then y = 1 MidHandle player(winkel#) DrawImage player(winkel#),x,y End Function |
||
![]() ![]() ![]() |
![]() |
aMulSieger des Minimalist Compo 01/13 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Dir fehlt ein 'Next'...
EDIT: @Todeskop: Das hätte es auch ohne deine Hilfe geschafft, glaub ich ![]() |
||
Panic Pong - ultimate action mashup of Pong and Breakout <= aktives Spiele-Projekt, Downloads mit vielen bunten Farben!
advASCIIdraw - the advanced ASCII art program <= aktives nicht-Spiele-Projekt, must-have für ASCII/roguelike/dungeon-crawler fans! Alter BB-Kram: ThroughTheAsteroidBelt - mit Quelltext! | RGB-Palette in 32²-Textur / Farbige Beleuchtung mit Dot3 | Stereoskopie in Blitz3D | Teleport-Animation Screensaver |
- Zuletzt bearbeitet von aMul am Sa, März 03, 2007 20:54, insgesamt einmal bearbeitet
Todeskop |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
über der hauptschleife also sooo:
Code: [AUSKLAPPEN] Graphics 1024,768,16,1
SetBuffer BackBuffer() Global geschwindigkeit# Global x#=300,y#=300 Global winkel# ;Spieler in allen winkeln speichern Dim player(359) TFormFilter 0 For winkel# = 0 To 359 Text 512,384,Int(winkel#/3.6)+" %" player(winkel#)=LoadImage("player.bmp") RotateImage player(winkel#),winkel# Next ;-----------------------------HAUPTSCHLEIFE-des-Spiels--------------------- ;.............................:::::::::::::................................ While Not KeyHit(1) Geschwindigkeit() Malen() fps# = (fps*19+1000/(MilliSecs()-ms))/20 ms = MilliSecs() Text 500,0,Int(fps#)+" FPS" Text 500,10,Int(x#)+" X" Text 500,20,Int(y#)+" Y" Text 0,0,Int (geschwindigkeit)+" Geschwindigkeit" Flip Cls Wend End ;------------------------------------------Funktionen------------------------------------------------- ;..........................................::::::::::................................................. Function Geschwindigkeit() If KeyDown(203) Then winkel#=winkel#-geschwindigkeit/3 If KeyDown(205) Then winkel#=winkel#+geschwindigkeit/3 If KeyDown(200) Then geschwindigkeit=geschwindigkeit+.3 If KeyDown(208) Then geschwindigkeit=geschwindigkeit-.1 geschwindigkeit=geschwindigkeit*.99 x=x + Cos(Winkel#)*geschwindigkeit y=y + Sin(Winkel#)*geschwindigkeit If geschwindigkeit> 10 Then geschwindigkeit= 10 If geschwindigkeit< -5 Then geschwindigkeit= -5 Text 0,0,Int (geschwindigkeit) End Function Function Malen() If winkel# > 359 Then winkel# = 0 If winkel# < 0 Then winkel# = 359 If x > 1023 Then x= 1023 If x < 1 Then x = 1 If y > 767 Then y = 767 If y < 1 Then y = 1 MidHandle player(winkel#) DrawImage player(winkel#),x,y End Function |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group