Community Projekt: BB-Party
Übersicht

Wie Findet ihr diese Idee? | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||
Insgesamt 43 Stimmen |
DjDETE |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Jo, nach dem 3. mal starten hab ich auch kapiert was man machen muss ![]() MfG |
||
Aktuelles Projekt: XXX |XXX | 3% der v1b fertig
www.emu-soft.de.vu Für die Homepage suche ich noch Linktauschpartner, bei Interesse einfach melden. |
![]() |
DAK |
![]() Antworten mit Zitat ![]() |
---|---|---|
ich check das minigame nicht ![]() ich bin grad dabei, das framework zu erweitern (alte spiele funktionieren natürlich immer noch genauso.) was ich versuch rein zu kriegen ist folgendes: -) bessere graphik (hintergrundbild, zb) -) bessere übersicht bei dem overlay -) grundlagen für frameunabhängige programmierung (will heißen, fps counter und eine variable, mit der man alles multiplizert wird, was frameunabhängig gemacht werden soll, sowas in der art) (könnte in dem minigame von lastmayday gut verwendet werden) sonst noch vorschläge? |
||
Gewinner der 6. und der 68. BlitzCodeCompo |
![]() |
Lastmayday |
![]() Antworten mit Zitat ![]() |
---|---|---|
ich hab mal die render durchläufe halbiert. jetzt solte es doppelt so schnell laufen:
Code: [AUSKLAPPEN] ListAddLast(GameList, New Game_HotSpot) rem bitte hinzufuegen: Import brl.PNGLoader und Graphics(800, 600, 0,, GRAPHICS_ACCUMBUFFER) endrem Type Game_HotSpot Extends TMiniGame Field fire:TImage, back:TImage, knopf:TImage, hebel:TImage, trommel:TImage, schmetter:TImage, seil:TImage, rauch:TImage Field rette:TImage, den:TImage, schmetterT:TImage Field fireup:Float, firemod:Int Field oldmx:Int, oldmy:Int Field winkelf:Float, retwinkel:Float Field looselock:Int = 0 Field myGameTime:Int Method INIT() GameTime = MilliSecs() + 13000 myGameTime = MilliSecs() + 13000 fire = LoadImage("mayday/fire.png") back = LoadImage("mayday/back.png") knopf = LoadImage("mayday/knopf.png") hebel = LoadImage("mayday/hebel.png") trommel = LoadImage("mayday/trommel.png") schmetter = LoadImage("mayday/schmetterling.png") seil = LoadImage("mayday/seil.png") rauch = LoadImage("mayday/rauch.png") rette = LoadImage("mayday/rette.png") den = LoadImage("mayday/den.png") schmetterT = LoadImage("mayday/schmetterlingT.png") looselock = 0 retwinkel = 100 End Method Method RUN:Byte() 'der Returnwert gibt an, ob das Spiel noch rennt. '1=rennt noch; 2=gewinnen; 0=verlieren glClear(GL_ACCUM_BUFFER_BIT) SetBlend(ALPHABLEND) Local mx:Int = MouseX() Local my:Int = MouseY() Local winkel:Float = ATan2((GraphicsWidth() / 2.0) - mx, (GraphicsHeight() / 2.0) - my) Local maxwinkel:Float If myGameTime < MilliSecs() + 10000 Then maxwinkel = BufferWinkel(winkelf, winkel, 15) If myGameTime < MilliSecs() + 10000 Then If Not looselock Then retwinkel = retwinkel + (maxwinkel / 4.0) For Local x:Int = 0 To 9 SetRotation(0) SetScale(1, 1) SetColor(255, 255, 255) SetHandle(0, 0) DrawPicture(back, 0, 0, GraphicsWidth(), GraphicsHeight()) If firemod = 0 Then fireup = fireup + 0.5 ; If fireup > 35 Then firemod = 1 If firemod = 1 Then fireup = fireup - 0.5 ; If fireup <= - 35 Then firemod = 0 DrawPicture(fire, 0, - fireup + 125, GraphicsWidth() + 50, GraphicsHeight()) If looselock Then retwinkel = retwinkel + 3 Else If myGameTime < MilliSecs() + 10000 Then retwinkel = retwinkel + 0.3 EndIf DrawPicture(schmetter, - 100, retwinkel - 350, 800, 600) If looselock Then SetHandle((50 + (retwinkel - 300)) / 2.0, (50 + (retwinkel - 300)) / 2.0) DrawPicture(rauch, 400 - 100, 1300 - retwinkel, 50 + (retwinkel - 300), 50 + (retwinkel - 300)) SetHandle(0, 0) EndIf DrawPicture(fire, 0, fireup + 125, GraphicsWidth() + 50, GraphicsHeight()) Local gvx:Int = -retwinkel Mod 32 For Local x:Int = -12 To 0 DrawPicture(seil, (GraphicsWidth() / 2.0) + 25, (GraphicsHeight() / 2.0) + (x * 32) + gvx, 32, 32) Next winkelf = winkelf + (maxwinkel / 10.0) Local newmx:Float = (GraphicsWidth() / 2.0) + Sin(winkelf) * 200 Local newmy:Float = (GraphicsHeight() / 2.0) + Cos(winkelf) * 200 SetRotation(- retwinkel + 90) SetHandle(100, 100) DrawPicture(trommel, (GraphicsWidth() / 2.0), (GraphicsHeight() / 2.0), 200, 200) SetHandle(35, 50) SetRotation(- winkelf + 90) DrawPicture(hebel, (GraphicsWidth() / 2.0), (GraphicsHeight() / 2.0), 300, 70) SetRotation(0) SetHandle(0, 0) DrawPicture(knopf, newmx - 75, newmy - 75, 150, 150) Local pushi:Int = myGameTime - MilliSecs() - 10000 If pushi < 1000 And pushi > - 1000 Then SetHandle((200 - (((pushi) / 1000.0) * 200)) / 1.5, (150 - (((pushi) / 1000.0) * 150)) / 1.5) DrawPicture(schmetterT, (GraphicsWidth() / 2.0), (GraphicsHeight() / 2.0), 200 - (((pushi) / 1000.0) * 200), 150 - (((pushi) / 1000.0) * 150)) ElseIf pushi < 2000 And pushi > 1000 Then SetHandle((200 - (((pushi - 1000) / 1000.0) * 200)) / 1.5, (150 - (((pushi - 1000) / 1000.0) * 150)) / 1.5) DrawPicture(den, (GraphicsWidth() / 2.0), (GraphicsHeight() / 2.0), 200 - (((pushi - 1000) / 1000.0) * 200), 150 - (((pushi - 1000) / 1000.0) * 150)) ElseIf pushi < 3000 And pushi > 2000 Then SetHandle((200 - (((pushi - 2000) / 1000.0) * 200)) / 1.5, (150 - (((pushi - 2000) / 1000.0) * 150)) / 1.5) DrawPicture(rette, (GraphicsWidth() / 2.0), (GraphicsHeight() / 2.0), 200 - (((pushi - 2000) / 1000.0) * 200), 150 - (((pushi - 2000) / 1000.0) * 150)) EndIf glAccum(GL_ACCUM, 0.1) Next oldmx = mx oldmy = my Cls glAccum(GL_RETURN, 1.0) SetRotation(0) SetScale(1, 1) SetColor(255, 255, 255) SetHandle(0, 0) DrawOverlay() Flip If retwinkel > 300 Then looselock = 1 If retwinkel > 2400 Then Return 0 If retwinkel < - 150 Then Return 2 Return 1 End Method Method CLEAR() fire = Null back = Null knopf = Null hebel = Null trommel = Null schmetter = Null rauch = Null seil = Null fireup = 0 firemod = 0 winkelf = 0 retwinkel = 0 looselock = 0 oldmx = Null oldmy = Null myGameTime = 0 End Method Function BufferWinkel:Float(turmwinkel:Float, zielwinkel:Float, drehspeed:Float) Local totalwinkel:Float = turmwinkel - zielwinkel + 180 While totalwinkel < - 180 totalwinkel = totalwinkel + 360 Wend While totalwinkel > 180 totalwinkel = totalwinkel - 360 Wend Local bufftore:Float, test:Int = 0 If totalwinkel > drehspeed Then bufftore = -drehspeed ; test = 1 If totalwinkel < - drehspeed Then bufftore = drehspeed ; test = 1 If test = 0 Then bufftore = -totalwinkel Return bufftore End Function Function DrawPicture(bild:Timage, x:Float, y:Float, width:Float, height:Float) Local nowscale_X:Float Local nowscale_Y:Float GetScale(nowscale_X, nowscale_Y) Local nowhandle_X:Float Local nowhandle_Y:Float GetHandle(nowhandle_X, nowhandle_Y) Local factorx:Float = width / bild.width Local factory:Float = height / bild.height SetScale(factorx * nowscale_X, factory * nowscale_Y) Local entferung:Float = Sqr((nowhandle_X) ^ 2 + (nowhandle_Y) ^ 2) Local winkel:Float = -ATan2(nowhandle_X, nowhandle_Y) + 180 DrawImage(bild, x + (Cos(GetRotation() - winkel) * (entferung * nowscale_X)), y + (Sin(GetRotation() - winkel) * (entferung * nowscale_Y))) SetScale(nowscale_x, nowscale_Y) End Function End Type |
||
![]() |
DAK |
![]() Antworten mit Zitat ![]() |
---|---|---|
ganz doppelt so schnell is es nicht, aber doch schön schneller.
hab hier mal eine neue version des frameworks. da keine weiteren vorschläge gekommen sind und mir nix eingefallen is hier mal ein paket mit allem, was bisher da ist. werd mich demnächst vllt daran machen meine minigames zu verschönern was sich verändert hat: ![]() ![]() ![]() TMiniGame.GameName:String: (war schon vorher drin, wird aber erst jetzt verwendet) Name des Spiels TMiniGame.AuthorName:String: Name des Autors. Diese beiden Variablen werdem vor dem Start des Minigames angezeigt. FPS_FPS:Int: rate mal was da drin steht... FPS_MS:Int: da steht drin, wie viele Millisekunden für das letzte Frame gebraucht wurden. FPS_SpeedFact:Double: Alles, was ihr frameunabhängig haben wollt, einfach mit dieser Variable multiplizieren. ![]() DrawText2(Text:String, x:Int, y:int, centerx:Byte, centery:Byte): funktioniert genau gleich wie der Text()-Befehl aus BB. Will heißen, wenn centerx/centery = 1 dann wird der Text auf der x/y-Achse zentriert. Hoffe ihr könnt was damit anfangen... Download |
||
Gewinner der 6. und der 68. BlitzCodeCompo |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group