Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - emook

Pages: [1]
1
Hi guys,

Don't if you've seen this before but it got me quite excited. It's a live demo coding tool written for Revision2014.

I've attached the compiled exe that you can run and code, while seeing the effects in the background.

F5 to compile changes, F11 to hide the source, ALT+F4 quit

Example in use :

https://youtu.be/j4baExLqNoI?t=424


2
Purebasic / Help with 3D cube code
« on: January 22, 2014 »
Hello chaps

I've mangled this together, but when the balls are near the camera, the ones far away appear in front and so on. I need help getting the ordering correct.

If you press space it will change to a 2d cube, how would I go about joining the square with lines?

Code: [Select]
InitMouse():InitKeyboard() : InitSprite() : InitSound() : UsePNGImageDecoder()
OpenWindow(0,0,0,800,600,"Window",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600)
ExamineMouse()

image=CatchImage(#PB_Any,?img1,?img1e-img1)
ball_spr=CreateSprite(#PB_Any,260,260)
ball=CreateSprite(#PB_Any,260,260)

StartDrawing(SpriteOutput(ball_spr)) : DrawingMode(#PB_2DDrawing_Transparent) : DrawImage(ImageID(image),0,0) :StopDrawing()
StartDrawing(SpriteOutput(ball)) : Box(0,0,20,20,#Red) : StopDrawing()

I=60 :SIZE.f=25 : SCALE.F=0.0008 : DIST.f=3
ANGLEX.f=0 : ANGLEY.f=0 : ANGLEZ.f=0
CAMX.f=0 : CAMY.f=0 : CAMZ.f=600
MODE=1  : MOVEX.f=0 : MOVEY.f=0 : MOVEZ.f=0
PIVX.f=0 : PIVY.f = 0 : PIVZ.f = 0
max=8

Dim X(max)
Dim Y(max)
Dim Z(max)
Dim PreVal(8,8,8)

X(1)=I  :  Y(1)=I  :  Z(1)=-I
X(2)=I  :  Y(2)=I  :  Z(2)=I
X(3)=I  :  Y(3)=-I :  Z(3)=-I
X(4)=I  :  Y(4)=-I :  Z(4)=I
X(5)=-I :  Y(5)=I  :  Z(5)=-I
X(6)=-I :  Y(6)=I  :  Z(6)=I
X(7)=-I :  Y(7)=-I : Z(7)=-I
X(8)=-I :  Y(8)=-I :  Z(8)=I

Repeat
 
  ANGLEX+0.001
  ANGLEY+0.001
  ANGLEZ+0.001
 
  ClearScreen(0)
 
  For n=1 To 4
   
    XD.f = X(N)-PIVX
    YD.f = Y(N)-PIVY
    ZD.f = Z(N)-PIVZ
   
    ZX.f = XD*Cos(ANGLEZ) - YD*Sin(ANGLEZ) - XD
    ZY.f = XD*Sin(ANGLEZ) + YD*Cos(ANGLEZ) - YD
   
    YX.f = (XD+ZX)*Cos(ANGLEY) - ZD*Sin(ANGLEY) - (XD+ZX)
    YZ.f = (XD+ZX)*Sin(ANGLEY) + ZD*Cos(ANGLEY) - ZD
   
    XY.f = (YD+ZY)*Cos(ANGLEX) - (ZD+YZ)*Sin(ANGLEX) - (YD+ZY)
    XZ.f = (YD+ZY)*Sin(ANGLEX) + (ZD+YZ)*Cos(ANGLEX) - (ZD+YZ)
   
    XROTOFFSET.f = YX+ZX
    YROTOFFSET.f = ZY+XY
    ZROTOFFSET.f = XZ+YZ
   
   
    If MODE=0
     
      X = ( X(N) + XROTOFFSET + CAMX ) /SCALE +MOVEX
      Y = ( Y(N) + YROTOFFSET + CAMY ) /SCALE +MOVEY
     
     
    Else
     
      Z= (Z(N) + ZROTOFFSET + CAMZ)
      X= (X(N) + XROTOFFSET + CAMX) /Z /SCALE +MOVEX
      Y= (Y(N) + YROTOFFSET + CAMY) /Z /SCALE +MOVEY
     
    EndIf
   
    If MODE=0
     
      DisplayTransparentSprite(ball,X+300,Y+200)
     
    Else
      Z= ( Z(N) + ZROTOFFSET + CAMZ)
     
      a=(SIZE /Z /SCALE)*6
      ZoomSprite(ball_spr, a,a)
     
      DisplayTransparentSprite(ball_spr,X+300,Y+200)
    EndIf
   
  Next
 
  FlipBuffers()
 
 
  ExamineKeyboard()
 
  If KeyboardPushed(#PB_Key_Left)
    MOVEX-0.1
  EndIf
  If KeyboardPushed(#PB_Key_Right)
    MOVEX+0.1
  EndIf
  If KeyboardPushed(#PB_Key_Up)
    MOVEY-0.1
  EndIf
  If KeyboardPushed(#PB_Key_Down)
    MOVEy+0.1
  EndIf 
  If KeyboardPushed(#PB_Key_LeftBracket)
    SCALE = SCALE*1.02
  EndIf 
  If KeyboardPushed(#PB_Key_RightBracket)
    SCALE = SCALE/1.02
  EndIf
 
  If KeyboardPushed(#PB_Key_1)
    ANGLEZ-0.01
  EndIf 
  If KeyboardPushed(#PB_Key_2)
    ANGLEZ+0.01
  EndIf 
  If KeyboardPushed(#PB_Key_3)
    ANGLEY+0.1
  EndIf   
  If KeyboardPushed(#PB_Key_4)
    ANGLEY+0.1
  EndIf   
  If KeyboardPushed(#PB_Key_5)
    ANGLEX+0.1
  EndIf   
  If KeyboardPushed(#PB_Key_6)
    ANGLEX+0.1
  EndIf   
 
  If KeyboardPushed(#PB_Key_F)
    PIVX-0.1
  EndIf
  If KeyboardPushed(#PB_Key_H)
    PIVX+0.1
  EndIf
  If KeyboardPushed(#PB_Key_T)
    PIVY-0.1
  EndIf
  If KeyboardPushed(#PB_Key_G)
    PIVY+0.1
  EndIf
  If KeyboardPushed(#PB_Key_A)
    PIVZ-0.1
  EndIf
  If KeyboardPushed(#PB_Key_S)
    PIVZ+0.1
  EndIf
 
  If KeyboardPushed(#PB_Key_Pad4)
    CAMX-0.1
  EndIf
  If KeyboardPushed(#PB_Key_Pad6)
    CAMX+0.1
  EndIf
  If KeyboardPushed(#PB_Key_Pad8)
    CAMY-0.1
  EndIf
  If KeyboardPushed(#PB_Key_Pad2)
    CAMY+0.1
  EndIf 
  If KeyboardPushed(#PB_Key_Minus)
    CAMZ-0.1
  EndIf
  If KeyboardPushed(#PB_Key_Add)
    CAMZ+0.1
  EndIf
  If KeyboardPushed(#PB_Key_Space)
    If MODE=0
      MODE=1
      SCALE=SCALE /CAMZ
    Else
      MODE=0
      SCALE=SCALE * CAMZ
    EndIf
    Delay(200) 
  EndIf
 
 
  WindowEvent()
 
Until KeyboardPushed(#PB_Key_Escape)


DataSection
  img1:
  ; size : 9119 bytes
  Data.q $0A1A0A0D474E5089,$524448490D000000,$6500000067000000,$6AEBDF0000000208,$47527301000000A5
  Data.q $0000E91CCEAE0042,$0000414D41670400,$00000561FC0B8FB1,$0000735948700900,$C701C30E0000C30E
  Data.q $741900000064A86F,$7774666F53745845,$6E69615000657261,$33762054454E2E74,$5D803B37382E352E
  Data.q $544144490F230000,$D71554079DED5E78,$106CD28039F7C7BA,$1A258B958A8D44AE,$214482C01092C4B0
  Data.q $02C1898D1A8D4491,$58A8D760D60C1A31,$B1280BB1511C2890,$7BD88586C5041600,$FF7AFA68B7B1358F
  Data.q $BC1C29CC3366DF3D,$DD6FAFFBDEF26E49,$5F37E7B39999C375,$AA91FEBFFD90199D,$26A761B0D3ECECE8
  Data.q $CD66AE346A35FA4D,$F0B48080E4971744,$9B89899931310DF0,$B5594E4E4CCE2F16,$F8B45A13C1E0DE6A
  Data.q $E8074BA51E8542B4,$8715B5B073197574,$95CAD5631D20BFF8,$D7F0783D1BEBE4EB,$2F3F37BBDBEE974B
  Data.q $3EDFB7A1EC6C60EF,$DD3AC3B1987AEAEC,$F41E7A790E150AE1,$27240E0F83E6FFF7,$CDD97173CD0D0BEF
  Data.q $58C2DB1872C60ED8,$CC66337171696326,$7B2F2F1F2F57B0F8,$974BB554BFFA8E1D,$F23319DACDA6D81E
  Data.q $E3F1C8E4723BEDF7,$E2223A73D9EE4FC7,$94E760C659CB8B8C,$FAFD54EC519D85FF,$B1C4E2713EAF5727
  Data.q $7C9C9CA1FDB0C763,$F0705E64647F6183,$B2DC6E36730D86AE,$6BB5DAE666664B65,$1B5AAD5510984D97
  Data.q $631BA038D7FE5CC6,$B43E8E8E4AD56BBD,$ECFA7D3E9D48176B,$ECF62EF2F217B3D9,$1ADF6332E1C1C979
  Data.q $678B974BA9787E19,$73B9DCE170B85CCE,$BB12793C9D7B1ED8,$9D9E5F010E877C73,$B6828373B5DAAEDD
  Data.q $C975BCDE71B2190E,$1DB5B12F1B8DA9C9,$D7AF5DDDD8D6E6EA,$23632AA9C7FFAF8B,$91E8F3399BCBD5EA
  Data.q $178BC5FF9C6D3823,$6B98CC6570B85F2F,$376286EC675CCA65,$391F5DD3A27FC655,$BD5EAF576BB5DAF2
  Data.q $5D2F97CBE5CAE572,$EA73399CCEF844BA,$41E8743A3BE029D4,$8C5DB197B6300EC6,$CBE673B3AB6C676D
  Data.q $13D3C520D06BAF2F,$3359A6D1A8D4A6EC,$EA847F94B1070707,$F8F8FCDD6EB93630,$DBEB0053C38FC713
  Data.q $37E9E91B8505BF6F,$DD8A5BB18EFBD5EB,$7CFF87FF053BB02E,$EFBBFEFFBFEF98CC,$371B8DE6F379BBBE
  Data.q $FCE71C3B07761F08,$8E9D4EC9E038F3F9,$CB19FB7606320322,$2F9736F292A76C63,$2BE5F2DA6974BE9F
  Data.q $3019CC848516A2A3,$8B4BA5D2A753B820,$2728B19E556DFD65,$17889622874303A7,$FDF000EBF5FAE5FC
  Data.q $2EE800ECEDB73198,$E1F8646FBB18F763,$E77BBDDEEE4321BD,$75BADF6FB7DB9DCE,$E0EC408E1D81F08B
  Data.q $324FB5DA99E6387A,$BE58C43BB0318276,$9764A3359AB2E9CA,$29C492C964B29292,$0D46A2DB6DB6A653
  Data.q $85BC912062B3DFDD,$508595963FF7F148,$B85C2EB7DA70BC92,$0F6301EA449BE6F3,$1F43430F64647B15
  Data.q $7BBDFEFF7FBAE03E,$0877E22BB11F08F7,$818CD38D141B1B76,$631F6E00E9C531DD,$371BE9F4DC1CB3A8
  Data.q $EA6A6A5D6EB75C6E,$70689C4C16CB65B2,$2954AB50E0E91F77,$B2A954AA89BFD6B1,$4A7D6EB50F2FCBE0
  Data.q $F4BA5B7FD7AF3FAF,$D5B8D46AEFD75775,$C9C97B8888DDE9B4,$8F2E9761F4FD3E0F,$BD13D2A95C78B45A
  Data.q $F9FF0CA83F6309FE,$7E3DDF77C9F3D3C4,$721F0F47A3D1F8FC,$ABD98C9DF91D927A,$7352BCEC645FD7EB
  Data.q $92CACACAF2F3834D,$CE2E30BE5F2F96E0,$32E74D8D826EB750,$BBFFA2C46C6D6C65,$EA3C4C49C808080A
  Data.q $95576312E17681E1,$E5E7BC60850C8EBC,$278E008029D4E0F5,$A14F0FC3F0FC9E4F,$2D2CFC3E1D9FF7FB
  Data.q $9EC2C2CFE9F4D9ED,$9F9A78F0F53DF9F9,$76A761A66C214F8F,$B22F32793EBBB03A,$6354226700285D8C
  Data.q $F82DC12AA10E0163,$51B1818787832BEA,$FFE962F6F6EE4E4E,$1D454547DBDBD915,$004E038384E63318
  Data.q $8EBC8F6488CA8327,$8BC5E1FBDBC0F5E4,$40B1FB3D9ECF5E6A,$8FD85847FF88153F,$7BE9E5795ECFCECE
  Data.q $D4D487F63B1D3DEF,$E0A2B6063F8FC727,$BA857EEF77AEE9C8,$511DC02A851C0513,$81810E2F2B0A038A
  Data.q $91919743436DB6DB,$A1AC6C6A878E3941,$95AA552B8B806572,$BC2F58BF8738BBBB,$FAFD37D2525242F0
  Data.q $37D0B3E82F104621,$FDEDE524862E4F7C,$D1816125E275FAE8,$FBA749F9C9CAC6CF,$53D8C67B151FB189
  Data.q $3C9A4DC7E7675B0A,$33F769B4C1FBDDEC,$346EEC4CBE5DEE32,$85237C380677086C,$554A37E9C65C7C2A
  Data.q $ECC6E363B0E0E3DD,$A7A7A7379BCDECEC,$5D2F272725A5A5A7,$0A85430CC67134BA,$B55ADDEA55286700
  Data.q $35D56AB55112EAFE,$C5CB1DDEEC1F57AB,$0FF948644839C705,$2FF6A4BA5F1E3C3D,$A5FE3F1EB18BF5E2
  Data.q $B11C0183199FDD6E,$F721A9425547042B,$773B771E1E7BBA75,$AAF7D7CD791911BE,$3E8A9C719C792BAB
  Data.q $DD6FB7DBEDB8DC6E,$6BF5FAFD6E0915BA,$F32E2572B959ACD6,$9C1CF5E8373FCFFC,$27676769E9E61F5E
  Data.q $FA57979796CFE94E,$73234D838307F5FA,$F0D32110E87C7D75,$632BF17C5F58D5FA,$AB1ED40E0C6628BF
  Data.q $404D40341BF021C1,$136FDEEF74F5E669,$CB65BE77EBF62E12,$68282DDD68CA6533,$37703939391D8EC7
  Data.q $BC342E161951538A,$1A0DE7D8A6A716F5,$E4F3FB138B3B3B38,$1D83E6F365B3E3E3,$FF6F66472607183A
  Data.q $884644A5464B2B38,$9C9CDFD5EAE8D37E,$B824DDD8CE034D40,$A1C0949547BDEF3B,$8C86C62CE1C9A1B9
  Data.q $9DE77D1C2613138C,$DCF3EBD01CEA7583,$7AA37705DAED76DC,$C4DE2AD56AB6EE4A,$A2E092F2F06F9FCD
  Data.q $DE9C51D1D1C378DF,$F29B4DA6D978219F,$FF4C85C4AE3AF57B,$F636CF6635C19722,$E7D3EAD5DFAF3532
  Data.q $02550C9C1260C637,$9E4CEEC1BBA4D447,$886F42E4681B1EAC,$507CFA8D1B430B79,$323BBB1B17DDCDCD
  Data.q $CA0C8CEC8CC67732,$2D168B6EE016546E,$F4E015B5B389A032,$BA93FA96DB6D61FA,$C361FEF17C32E439
  Data.q $94D761285CA80810,$8F08E0C813150326,$904C8737FA42753A,$DF9B1B77F87C3A92,$3511BBA4CE046A15
  Data.q $0346A4864676EE09,$231AD685A4C35103,$6F9BF87C3E1DA82A,$EDF69EFF7FBFD9BE,$DD4B76D6CDB63077
  Data.q $62F8BEEBA1A199BA,$12DDDC6EC8A5D2CD,$C10377483A1D0D13,$132DF87FB64141C1,$8DEC562B15D75757
  Data.q $E28BD48363623989,$C40C9A197D0CE945,$2ABD5C9E552AA3E6,$6F5A948298135363,$8CDDD26A6A6405BD
  Data.q $E975B9B1B3505483,$B30D492CC61A8692,$A820F0783917DD3D,$261B74F9841A0DE5,$34B181B63236C616
  Data.q $848596753AE49B1B,$EA259ACC328A8C2C,$FF5DAEBF73B39929,$B9DCEE78018AAAC8,$74CB3B3A0E5253BB
  Data.q $8F36369B1E335B26,$D494829B10B66F37,$E66A1AF5EBBFE3F1,$D7B2BADD5A90AD7C,$4D57B186A6A09AA5
  Data.q $15CEE77B0381C0ED,$633A58C4DB184477,$4963056C654B196B,$65ADD9E07077CD8C,$3A9D5C02B2D9434B
  Data.q $2B9FFCE715B6DBED,$0681F6767B7C3C3C,$E868E08E689B100D,$745F6FB0F68ED498,$BBDD6A69808B26B3
  Data.q $B524D1C8D4CB3213,$9B6A5ACC84A1A1FB,$B19B2C65CAC06337,$D5B18EB630658CCD,$C08963096C64AD8C
  Data.q $9090C53298636364,$7C07E7E0D43A1860,$9C4753A9D43A1DF1,$C9A15AAD56A27FF6,$3472751403E0FBCE
  Data.q $CDC019C2B4640114,$864CD1942B95D1ED,$DADBBFF3F9DA96A7,$DEED494F0859906A,$04D4238CD1D2B1D8
  Data.q $9A81393B777BBDB5,$C55B186B6A0E6FBC,$04057F9016C652D8,$D311110DE3E2A418,$FE4E2B2D96CAA2A2
  Data.q $6767368EEEEEE4F9,$7534748D8DBE5C5C,$1B18B9DCC0EBC683,$93ED7D6668E93525,$88C80D4733224C4F
  Data.q $6AEA6A6334B49DDA,$EB6A6A9ACD5A8260,$116C632D8CC96A15,$A0A67330DA5D2B51,$9EE572D3F63B1A46
  Data.q $D9F6F6C9CF61BD3F,$71BC3F2F977B0E0E,$97090973D4D4C9E3,$90CDC0603ABF8FC7,$B97171DF1B8D5B90
  Data.q $D5361A456639BCDF,$F8F647106EEC66BE,$906B2F11CAE56FF1,$773ADDD3A47B4749,$D50D5079D34D4D4E
  Data.q $A14D2D434AD56B52,$59DCEB811B529CB6,$5060B9B6DB6A92F0,$6EB74760B92AF972,$E110D147A3D1C158
  Data.q $C48DD62E58956292,$1B0F56AB7EF0B18C,$0F864F3BCEFC7A35,$C7EF2F2CF4949A7F,$5BF706A6EE3577BB
  Data.q $41ED1C1664058242,$D4B97753471A6AB5,$CEE75A8451E751AF,$50D14B5128CA1A92,$8D8D8A92C04552AB
  Data.q $B3EC5F1A79EE5729,$16564F65C5C7D510,$21F5898B886B8116,$9A96A73D58C5608F,$9C43386272814BCA
  Data.q $97A7FEBD47F84E2A,$F93F9FDB6DB9FA5E,$7F73725FF8F897E4,$446A3571D89B7DBD,$EE2BE1906B2F24B0
  Data.q $6A4A3524C848EC75,$2B9750C89E503662,$7BBD5DBCBCBCB5FB,$0BC6A49AFB503553,$9F5497823198D902
  Data.q $E2B7A8928905DD3E,$C3EDF6FB5151B968,$AD416D1DF520B03A,$E249C31386A25369,$04C0580105380554
  Data.q $D7E6D36D7F95CA9A,$1F17FBDDED7F93C9,$C80B2F251D1C5F9F,$3619DD87C72A6078,$6014B29E1D4C8D4C
  Data.q $D02222D422898891,$282D4D58B6A49879,$777048484A92C048,$F8256553AC3010F7,$AE03B1DAEC7878B7
  Data.q $B0B805109AC79F0E,$53E0EDA85252D485,$85706A6A6A927281,$EE467F6C296362EC,$469F9494E7F2793B
  Data.q $351AC7F83829FA8D,$AD6E2BE19016A1E0,$524D3476A646A158,$9EF62E3E7E5513E3,$1AFD4E1F0E767B3D
  Data.q $CDCD4856BC9A1E75,$82C1AF57AB52C04D,$F0F6748A530A7587,$13405C375C62F8E1,$3139543513359AD4
  Data.q $67191C08DDC6A79C,$28541B8DF3F76767,$C86A101D2848F890,$30FCE4E69EB75BD3,$F8FB1E7D3E93D66B
  Data.q $36B860BC9474723C,$9A38D323511C8F37,$1DEEF76D4922CF0C,$FA972E806CD22713,$1309B06A5AA1AA35
  Data.q $CBE50D73B9A92C04,$CED2AB938A4810D7,$9382CACF6DB9B864,$9CCDDA868D581163,$7702DCBA9B8F711C
  Data.q $20A0BE04EC938353,$D91C5E041600AA81,$7162142190E8A7D3,$3FF7FB07BDDEFBFB,$D7DF71111FBC4C48
  Data.q $4C8D54BE1797AEF7,$5393C26873D468E3,$1B354B20A50D369B,$ECF5901AB0A3CEC8,$A8211A1A15A96029
  Data.q $3F9BD03441642714,$D44E7E17373738FE,$EF66FD2C35253170,$A6EE95CBA8D7E8DE,$AA974B7C09D92701
  Data.q $159025E1A5804149,$6ABDBA29EE86F8DC,$5E0605AF95CAB5D5,$E6DF49492BB3ECFD,$78754F564D1C6BE7
  Data.q $928626372BB5DAEE,$97435386A0A1CD1A,$099ACD6A115AFD4B,$54AA509D9ECD6A52,$5AC728CABCC60155
  Data.q $9DCEDD6EB594E4EB,$2C35F48758F5F13B,$CA37B3D9DAF91714,$C18CDDD2C187A194,$BDDE9F1D1CDC7649
  Data.q $531742AF24A4984B,$77D15775E2321178,$A578986F5DD186C3,$06E7FEFE0BC562A1,$0EC76A7090933A0D
  Data.q $4DB7FAC4F0C9A3B5,$CAD7C14A8D494E9F,$86A5A4C10A898A1C,$6C123FBDBCA4DE49,$0604376E19402BCC
  Data.q $6EAE0AD715BADD6E,$6FDD18E9F4EAED4C,$62380D377481E32A,$923123B1D0FDF127,$AC24C5DA9788B092
  Data.q $283D7DBEDF6E8A3B,$F9BE370564097888,$EEEE63EFBDCA344B,$CFE787850FFDFC47,$E13D5E56EB7FBB9D
  Data.q $7852673339B9B968,$1CC4138A02A35252,$49A4D91910AABE8A,$58C57FFBFD5A9482,$633EC2528C3EAF31
  Data.q $C4350D6CECEC94CA,$37B78AE34208F202,$E0C66EE4550C50E6,$04C278F8BE04ECD4,$3224BC92C2482911
  Data.q $4552A95D4B9E8BC9,$F920F91643D182F2,$87F37DEE80C4F2B8,$B67755AA9EDD3A06,$2323B24F93FDB76B
  Data.q $8D49D53C21D9D8B7,$5C3C2DAA87310EDA,$B5A1C1C1350B5290,$BAA56395154A63C0,$80E4E4E7A7A664B8
  Data.q $9207123F3835E51A,$D5BF7BBDA5C8F22E,$34E034DDD22F11EB,$9178BA3CD8D9B8EC,$2C24BCC658494918
  Data.q $E9D65F4FA703CF88,$34742B2119782F24,$CA79C90782C1D905,$71B3D5123F7E5123,$ACC4C664361BCDE3
  Data.q $754AB55BAFA3E8FF,$C664A02DA6A4A373,$2105CFCB65A915A3,$8EC74D6E1CA4EA53,$B205321A92999999
  Data.q $C7E38B84153AEA2C,$E0D4DDC85E239AE3,$56621EC8EC34E390,$2F31961241488955,$02929EBA09F9A2C0
  Data.q $4F2A6C48AC179258,$3CABD9643C150F42,$A075E356DCA9DF7E,$A7A7A6371B8DF379,$252D2D2D2EB75BAF
  Data.q $888D2D5F57C56525,$0A351AFCDDAED458,$69302168B593826F,$5A6652BCA0961614,$F897E5F6993494E3
  Data.q $6A255A4536435026,$C6B75BE7A414B748,$93824CDDC0BC4735,$240268E8C138C8EC,$11788CBD9E20A445
  Data.q $CD5A3D195C09392C,$8E1362191265E34B,$1D793D9A347147B6,$1B0D86C07835ED78,$2757ABD5EBFAFEBE
  Data.q $E2F17CBE5F2F2727,$E2E238E02C160BC5,$BD4310908691910C,$A4DE70FE7B7B067A,$AA137C6453074FA6
  Data.q $5A75F4E4EE5EF0A0,$52136A390A1A9A9A,$767673FCFCD20F1B,$9D9271C870630738,$5A8E895BADB71F1A
  Data.q $4E70C16307196F3C,$4960307052ED1EA2,$A4D8EA674C99125E,$D368E1A29B115117,$95CAEA6A6A5A3A46
  Data.q $C494949A5D2E972B,$31186F1F14681B9F,$0D0222218DA6D0C2,$E0B87BBB94A1F887,$DBC2BC4A954D5454
  Data.q $526D369BB5DAED7B,$9E90436A40414353,$BC4735C74B13399A,$270071CA38254E20,$F3BB95CBB77C49D9
  Data.q $35244C2208C4F7FD,$A12425A1488BC92C,$EE42F126B35F3DA7,$D9D94D89A6449987,$ED5EBF5FAD050466
  Data.q $E170B8592C964B68,$1212B50E05F3F9FC,$406F5E8F785DDDF8,$39CFF3E1A6F9BEFC,$4DEF2B66D7B5E84D
  Data.q $F47AAB052943D569,$FED1C250D49195C0,$F563BBDDA41E3510,$74E4701A6EE4ECB8,$1D1206056EC8EFD2
  Data.q $1792584914B19E29,$1C0033E69DA12261,$734C54305827AF5C,$4A9B1856409B10C8,$C1A332BBEEFE968F
  Data.q $E11347065B2D96D1,$CD271C88CA655269,$82487E7EC03789C9,$3C930B4AB1ABA626,$28CA1A868E2E2271
  Data.q $E901385E5E93B6A5,$ECD4E001950E046E,$23A244E2704E3E24,$AB9D0B0A25209845,$B57AB000F8815490
  Data.q $2B224CCB90BC4584,$5B3A0640C3059BAC,$92A9548D1D2B4E94,$CC66192F4BD91A96,$E8E48B0165F97C08
  Data.q $2BD6EB416C4180E0,$F379BA9A9F5B8DC7,$A93DEEF6C76A6366,$A71937706A23D63C,$CECC138C8EC4706A
  Data.q $5042520984523A26,$1B73082602C11738,$258268E8D9F54D09,$267486405BFD2179,$66B2190D423E5ADB
  Data.q $1C9668CA34721ACD,$74AC8BCB4753AA0D,$2F057DBEDF6FC469,$47A33EF9D5EAF552,$AB5569F5E856DDC3
  Data.q $33B0180F64040666,$BCA328ADD6DF6E2E,$29E57004E0242420,$38EC34E046EED548,$804FB4CAEBE7673E
  Data.q $02C1167B52098448,$50D0A9D269DA1226,$46449A62A8BC4582,$1F19026C519006AD,$5AAD560451A3A206
  Data.q $796B1B8D41A39565,$82D1E8F4753A9B49,$B09F7CA6D369A917,$5F0D618CEB435030,$B974EB641585CB89
  Data.q $FC7FE5F9F9E52A95,$91B9B84E2D1691F1,$9D3B5383537651BB,$61241486A5B2D7C0,$A1268BA1488B3DA9
  Data.q $82E724F4F31D2431,$24C322C519351781,$3A7D3D5CEA63F580,$45B470158AC57362,$7B791A9D2899168B
  Data.q $8B8B8C8C8B49616B,$280BD44DF998F22B,$86EF81FCC3524424,$5DB2B1F3C04D23AB,$6FE6F7D16021C6E3
  Data.q $0703E39CCE7874DA,$45CAA55738080E9E,$70F0B42B835771A5,$02F319059E448989,$69D210861083F423
  Data.q $E2305CE47676E40C,$D13C346439997D45,$15226267531ABEA0,$5AF82CB2CD1EC281,$2055D5D5DCF85EAF
  Data.q $D169F7C3E9F4FA83,$7C5C460703146502,$9B5095506AC3512B,$BD07B3D9ED252676,$F22D843B24538608
  Data.q $2F8F3B9D91EBCA1D,$3B1D73D0E87A7058,$E10D8DB2F359AC5E,$D8C81520289896E3,$AA68452C04C8D4BF
  Data.q $5E22C11482A6A44F,$0699726997D93170,$AC89070714CE4619,$2585A86C3524D8F8,$FFDFFBFF9F14342D
  Data.q $7DF0864321A0C816,$C5F171186A26D76A,$B59611EA07580D48,$F77BB59591DFAF5D,$C1271F43811BB86E
  Data.q $8E5068405CA1EB21,$A3D3F2F97270381D,$D25262F9DCEB9F47,$20B044148967B3E5,$2C1191262E54BA9E
  Data.q $8238DC7474351D08,$0B865F518B917925,$559708E94D191269,$49362AB33A52AB55,$7C7DCF88EC75A816
  Data.q $7CE1F0F86832047C,$EE512ED330954A9F,$82C08E402B29A5DB,$62E6E6E7BBBA9078,$53831A9C51BB8532
  Data.q $98FC290DB6DAE3B3,$33F5244F4F71EDAD,$3D1C2E5252E7D1D1,$E85E1A62ED4BFD2A,$845E48BA5D43A1A8
  Data.q $DE3548642ACCBC8C,$D0341AB54DD556DE,$DD6F3E2DB6D692C2,$72DA3D0C63FB755A,$D1457E018078C171
  Data.q $DBED9349B483C6D4,$DDC1C083B1D8EFB7,$FE6F0E20ECD4E034,$EB0FD194647AAA7C,$9BE6F63F57AA47F5
  Data.q $667494953D0E8627,$21BD0BCD4C895EEF,$92F03174A1B0DF94,$914566B793038CC8,$ACC8476BB69614E1
  Data.q $D2585A5AAD524D8A,$3EBF55B79F1D7F5E,$63E23A39C86E8933,$4056290478662904,$1C1D16DB6B839495
  Data.q $8702538C9C4D0DDC,$EAE7F9F42761A71C,$F9ED4CBAF32647DA,$7850EFCFD078BE2F,$80393963B8B891F8
  Data.q $3EF0F87A3A179985,$3298146422F07B7B,$335B21EC8000D3FD,$190395800A88E9BA,$674DAC3D1EE2CCF2
  Data.q $79ADA94845EEEE52,$0C812753A9DE7C73,$4E7728FBE189898A,$4DD90DDC0B8B6EE0,$C0165656686869C4
  Data.q $8E0471E34E00E3C1,$189B7EDF077C49D8,$5722B67576A4D349,$5B2D7D97173C9A02,$F763B1FCC3F0F81E
  Data.q $6A87E1D3A79CAE54,$B033EA3204D8EA64,$B33C953628015148,$B39499D36B50E868,$9F0AD56B6A521173
  Data.q $F6A710640A868687,$37701FF40B7257D5,$32571EDC1D2E3D7C,$765C0030300F83F3,$5D869D392A853676
  Data.q $CA4926121B0D7C11,$D90D085C46449798,$D65A5A502DFF7F76,$FDFCDB6161D969B4,$1731B1B5CB55AB73
  Data.q $2C3472665C34709B,$732599CCC166791E,$F349B87AF4EA0C34,$190221212126C7F7,$474E8FBE04C26134
  Data.q $28C5715BE026A05B,$4CCCCC8888B8394E,$1A6DB6DB6E04A7CC,$AE58872089663276,$4B0464520692011C
  Data.q $14F8322CE4307A13,$6757C22A36EBE148,$BD586FA7A7A46464,$A5FAFDE969B4C37A,$9D8666B3519369B7
  Data.q $CA67778D1C26C51D,$65B2B47726C41493,$323214663368EC4B,$EDF6FB49B01D0EB6,$B77C51A8D4683205
  Data.q $6EF86EC846E4A552,$7C3E1B83852C375C,$1E04CE3A580D86C3,$474C876256EB75B0,$9D98271F12B310EC
  Data.q $250FD1A4A1C85C4D,$61062191488C892F,$AD908BC4A39B945B,$C69875BADD7EBF5F,$668FD3424E625A31
  Data.q $5DF6FB2BC9E4E56C,$DA57B5DAAACDA6D9,$2CF4F3470B4AE3DB,$37D3CB87C341A399,$FDFDFC4D8DBF6F61
  Data.q $BBE33ECFB3E83205,$5948B6EC952D77C9,$DAC46237071EAE01,$064E009C6EB16BB5,$D4EFC8E990EC4AD1
  Data.q $08E2298BC5C138F8,$14925FE923E8C68D,$4CCBA74DB61E990C,$5B204CC170BC954D,$626A0B7A18ED12B9
  Data.q $BF1F8E24242567B9,$87CFDBED05DF6FA0,$92FAB4244A77C06B,$D569361EF7BDB191,$8030180D064095AA
  Data.q $0BA8EDEA0BC2F6EF,$68B172C70F86E011,$0876201701A71EAC,$D2704E3E353BF258,$5B8D31A71190B024
  Data.q $7776CC7D432A4C71,$2929641A5E48B7C7,$26B1343213903429,$8B8B859C3C94323A,$69FCFE3E542351A1
  Data.q $0ADFA93991F154EA,$8DC6E35609E53637,$B77C6EB75BA83205,$E0E382529B34552A,$757ABD5DE5C08C46
  Data.q $FC1D9A9D391A5A5A,$1090381C138F8D4E,$D0C52008AC68EF90,$5E6A96CB736DA846,$0C321005864246F8
  Data.q $91DD37EFA89518E4,$A6086E1739A8AC55,$30B08681810CF57A,$D263620909072BFE,$71B8DB57B768AF2B
  Data.q $F419022A954AA4D8,$13CD4CDDF06F1BC6,$B8700A1614545C02,$D8189C193874E4D4,$F0413E11DF22CC51
  Data.q $24C68A09FCE9B7ED,$89A8645CF442941D,$5C245220F47BD2D2,$4D6268644997B52A,$C966CACA67336477
  Data.q $7357F2EB750C1C1C,$96EE66C2BF90FC3F,$8484DCEE75B50C24,$7F94A18E0FBF2284,$370718AD6CD7F619
  Data.q $6345814101C22874,$3B83B01F3874E4E9,$E081F791EB80A150,$D0D17240893F3F26,$CE8640F74305B741
  Data.q $48B3C8A351DADA4B,$85D3323532E51792,$A56F1429CD20D072,$FCF186C32C87F34B,$FDCF22D56AACD685
  Data.q $154EA7535AABF8DC,$20EC072DE81548BC,$0588E1E1896A2BB7,$C8EC96A5C62B15AC,$465F791F1217E0EF
  Data.q $D5A0D1260A6AC6E3,$5B5081A18547A182,$C649B5C3E380C1AA,$E8CC89092606CCBC,$D4AFB14F4F318A14
  Data.q $6FBFEF16B40679BC,$8B8B8869FCC5F5F0,$2E9D3A48BC148C8C,$8F6A9FA7C32CD676,$5B5C44B1F7FDED25
  Data.q $A3B1069C3A725F64,$C3D0413E03D72598,$29F0DA8586A7CD03,$BEDAA0FD0C16AD0C,$521E5C21C1C17176
  Data.q $17F59A3A10917809,$1183829CD187746B,$C5F4FFA8DF8CDDA4,$C8690FC6968BF917,$6EB18AC56B056E94
  Data.q $C207707604A70EC9,$E82E2E698207DE47,$0C11F464221A613C,$1A52DAA0FD0C3D0D,$9601015F08230235
  Data.q $551C862BBDF1579A,$B9482C63C1AD69E3,$CBCF4205449BAA0C,$CC0B448C8E794677,$4849F72AA13AA9EB
  Data.q $50147AE93D38761A,$EBF41BE61D9DA09C,$006C309FFD4380D2,$38C1C1E5B1A83343,$E2F1F045F0913032
  Data.q $95B65CA7BD0A4BFD,$1637762B1B1F6486,$952A04E50CB95542,$85362C7F1FFED3AA,$B911A905C5E74FA6
  Data.q $D9240B0FC557D5F0,$6FBC1F120BE0C4E1,$C2C630F1682592E5,$66C3047D1B199330,$881C0D25908730D2
  Data.q $48BCB59059E09323,$5359AB4AC3891888,$178D8C1128526BEC,$4FEC2CD8CF4A8A9C,$33359B0170B1882D
  Data.q $839B5516DBC1E8F4,$7C1F0817C159C1F3,$79878B478F8C1384,$D806D19CC7118610,$3FA388A653896352
  Data.q $F7331AC44D40809F,$829EB189D9091136,$C595CAFF61FA9193,$3B3877E572211AA6,$1454537F997E5E1B
  Data.q $1383BC1F088A224F,$81716C1E2D0B359C,$A66D39FC9B55A461,$14E7C0744E4E45B6,$7E33225075BD1A6A
  Data.q $434DB0351AAD5995,$32E47F60AF48C901,$6FEA84F42C66D7BA,$43D1A28383534322,$4D27F37C023E2B68
  Data.q $2342D8A05B078B42,$9D4622B368C39FA3,$2C2BB48FA3EB73E3,$C60846105ADCD0D6,$2AD8A78FF6663266
  Data.q $A4683B1777BA1B1F,$C70FE797CAC62F20,$1536EFE1D4EBC550,$D343F934AD231CFC,$ED1F1F23CF3B2AA6
  Data.q $2B50D15FE3358B01,$A8CC8410F4DB0424,$A341D8B6BB528E3B,$ABA305997C8B2D96,$118FE68E886F1F17
  Data.q $0E0656DAB79D7F5F,$3DAA0DBCA5B9E59C,$296A40EBFC66B160,$354663C0B6A5387F,$7E6C7CC9A9041470
  Data.q $0321633F5A1AD072,$6B68FA020FCE1F0E,$94E7E4865535DDCC,$D21173999CDD2E85,$8BEBF29266D8D1E8
  Data.q $E0A6B2658E1468C5,$5FEBFD82CFBFA89A,$1DBF87339A0B1762,$C91013AF7F2BB5D6,$A1CF06C450979513
  Data.q $AD0C6B0CB22B5ED7,$804FCC62DFA10595,$ABC62CE0135E28B1,$35992D2DB7544FC7,$D9EF8D444F2234D4
  Data.q $204B9A5058B3BF93,$0D962566AFEA2784,$B6B60DB422F85BDB,$1BC1DEAFEAB31833,$D59D8A070388E0C7
  Data.q $4BED8ABABAD732B2,$487AE011C4DD6EAA,$30C779DE1B9BCD28,$280C076577558864,$636DF5FEA695805C
  Data.q $AC5414DE6D876BB5,$F28CBB64D11C3350,$7CFC94867356FEAA,$FFB7E0542A7050B2,$E2B1D8CE2DE0743A
  Data.q $D2640EBC2CB54FC5,$6B1AFB164F266170,$049CC61CC59C6CF6,$FF04030139842B12,$D9E9669B4D1A03CB
  Data.q $46B2B3E313D43497,$3B3B3399439AB528,$5119C2273C6AB543,$2C6D9A27E2A6D004,$6D88EC7505A0921B
  Data.q $836E387AA468E04A,$461379596A10E206,$39E98908D6F82BF3,$91C51E5F5F327ADA,$345BA3FFE346BC91
  Data.q $85A1A3B2CC86F377,$5EFE79F3A50A5528,$40E241A0FA38C7D6,$D0CE6F5FD4BFE852,$620F6946A3549752
  Data.q $841C86163431A1BD,$79F5FAAFE467660B,$DB16B75A717795B6,$6B83BE8BBE929498,$5DCEEEEB1633CAB5
  Data.q $4C4257E6BC042D40,$B5F7FDEA928ABA1A,$150A5659E0D2B107,$683684691A13FD13,$0104E6AEAFCC1E0E
  Data.q $CA4D42D7F6B3A75A,$99A1E8DDEE326B1F,$4B22149907DCB365,$1ACB777D4D2B1073,$0831A990D0AB3929
  Data.q $610D62019FCEAF56,$F93FE17C763BB361,$CD18306E9D7A4F4B,$8517C5F48FBE259A,$D65495BE30CE6EAE
  Data.q $4F379E1386C6B9CC,$0DD42CB9C11AC11C,$FFCE2269349A45C5,$98B869D96CB655B9,$487D72A8C7F09A4D
  Data.q $4E06F298D3EF9A13,$107340C18B9A8409,$94AC11C577DDEC6B,$F7C9D13D3CFAF785,$BB54C95A4EF669EC
  Data.q $475C7E40C0F8ED76,$581EF1FAFD9E1E47,$1633BE7966C67DFD,$676731AC11CD305A,$47B5FDFEAF59993E
  Data.q $1D1D1A9D4D438690,$DA6D76BAF9FE47FD,$70D010503BF21070,$8D0D20BC7DAB6DB6,$11CD41E44A26896E
  Data.q $4235BBB160E0B1AC,$0F0B6A411DAE69B3,$38A2B158A989898F,$5047AE9D3A443FE1,$EC050F1314399150
  Data.q $FC6396A12ABCE9F4,$08D520DF2CC29F94,$D7C70635AFBD4017,$69D0B425C20B5C24,$51E1E717171AED76
  Data.q $7D7AF495627ABFB2,$BA5D581BEA668C5F,$6FA1A5F97D493588,$E2616183E0895E5F,$4AD61E453908D687
  Data.q $7FBDCA56B7655E53,$FABCDE6F301016D3,$6B65C3FCF38BEBF5,$081AFD9550811B6B,$ABF80F83E9CCD1C2
  Data.q $73C2C8B6F13A9D28,$D565A0576F495233,$D4DCD1E6841659F4,$ABEAFF1F109DEDE1,$F9648493FC338AAF
  Data.q $B98B828D39382629,$FB90E2E17C7E35FC,$3E4F67B585E2552A,$B70A9349857A6803,$98658BE5BFACD2B4
  Data.q $FB3D9DCFEBF5674B,$B7AE3C11AC33E80F,$5896F5BDC7A15797,$E8685710BE8AB19F,$A19F3190219DD098
  Data.q $A1B2C0D9A36743FB,$B26954306A59592E,$7A6733399F1F34AD,$E2840BFAB3897979,$33BF071CA74B09D0
  Data.q $50B22BF3F2423BBE,$437704623C728673,$84C698FD5359AC70,$CCE2E3C97795B881,$B4DA663ADD6D1B3E
  Data.q $D52BF9F38BABD5EA,$95CA8F94B9D56AB2,$56B22C8E47315D33,$8FC127B621111673,$DD02C6F00603B310
  Data.q $6D705AF93D5B4235,$08AE44D164CC80B5,$D99B9BA472391C0C,$A72725EBA7F09ABF,$513977F076EFCAB1
  Data.q $49B45EAA62858D40,$C1B441E44FDDF62B,$1DCDEEF77531AEE8,$26A7C2D5FA17F8D3,$AEFF7FA131D1CCBD
  Data.q $A4B8507FF1FEBB5D,$E21C7D1DDB6B652A,$BD8BA04F134562B4,$3733BA14AD7D8BFD,$B30681E3911DC2B7
  Data.q $EE48C8EBD471A60A,$9BBBC98358AC28A1,$A351A2311CCEAB55,$727235077FDD6246,$A85382B38EEA869A
  Data.q $8550C8135730D385,$FBB597E5F6C211AD,$8330A80161781B1A,$C81F1BADDB3AF106,$3359BFD4AA54FDD1
  Data.q $2A3EFF72C5E5F297,$A7557EBAB887D7AD,$A6E73411C14F368E,$1FD79AC8D6B84C36,$C8E469CCF134B65B
  Data.q $BBFC6B13D7ABD5F1,$0268686FA5C5D5CA,$A796A2352B0A1C72,$9CCAECF908466B19,$B3445C2BBF2AECA1
  Data.q $FFEBD40BF3F6CF67,$217EBA661C8EFF31,$03F80D06BE88F121,$E3B17FDDB370F091,$F6F3CEDCC53E9F6A
  Data.q $0705A6B359A216D6,$67E3FD47FE7677B7,$59A5E97E75DF8205,$637E77773738AF28,$8B661C9DFB882823
  Data.q $EA190962121235BD,$C0B8CC4C46C9E68F,$587FAAFE1C1CD7C0,$B95AA552E9534FE4,$B2B9579DB5B10CB8
  Data.q $C3BE46CE42902CF0,$BA05D6F267DA8B54,$A1E757ABDAB70B07,$E075379BCE1F9F2D,$FF65FDAA7C7C77C0
  Data.q $EC7CC647265FCB0E,$AABFC8C50504FAEC,$2C447F00A08BA5D7,$F8C361B1DBC76BB7,$A349190BE5F2CE23
  Data.q $FC43065F5BF4A2DB,$D7D77A0D06A3399C,$F772FFF9F9D9D3D7,$F6572A97C338453F,$C608D6AB55EDF5F5
  Data.q $A000310C20B2D162,$101C130310080E25,$CBA8084C5B3A05A3,$341A0EE77D7C3F18,$6ADFFDFE93EA2A3E
  Data.q $F73FC38787BEAED7,$FF6F68E443FCBC5F,$9B4D9E9E9E8AC562,$BEAF0EF5FD7FF536,$F3D5EA025795FEDA
  Data.q $194D74EB5ABFD7FD,$121F7FED24FE54F3,$C5C15D757203FF63,$4900000000100242
  Data.b $45,$4E,$44,$AE,$42,$60,$82
  img1e:
EndDataSection

3
As you can tell by the title, I'm not sure what I am on about.

Well I saw the UDG demos posted for the UDG compo and really enjoyed the creativeness that was employed by some of you very clever people. I've also been playing with tinyptc for Purebasic and have come to the realisation that to do funky stuff you need to ditch those inbuilt easy command and start poking with your frame buffer. The more complex source codes I check out, the more the frame buffer is being abused and manipulated to gain great effects with speed.

So, I would like to create something UDG-y. using 8x8 pixel blocks. I thought about drawing my routines to a backbuffer then peeking the results and then using a workaround of x*8,y*8 then drawing blocks 8x8 to achieve the results. However, this is where I get back to the framebuffer - my testing seems very slow and I can only imagine once I start getting more funky stuff flopping around the screen, my way of doing things is gonna slow down way too much. And i don't want that.

Here is the code I have put together (purebasic) :

Code: [Select]
InitMouse():InitKeyboard() : InitSprite()
OpenWindow(0,0,0,800,600,"")
OpenWindowedScreen(WindowID(0),0,0,800,600)
; 800 = 100
; 640 = 80
Global spx=CreateSprite(#PB_Any,100,80)
StartDrawing(SpriteOutput((spx)))
For Radius = 25 To 0 Step -1
  Circle(25, 25, Radius, RGB(Random(255), Random(255), Random(255)))
Next

StopDrawing()

Global Dim pos(100,80)

ExamineMouse()

Procedure MakeScreen()
  Static.f angle,sS,Cs,zoom=5
  sS=Sin(angle.f*0.5)*10
  cS=(Cos(angle.f*0.5))
  angle.f+0.51
  ClearScreen(0)
  StartDrawing(SpriteOutput(spx))
  Box(0,0,100,80,#Black)
  For Radius = 25 To 0 Step -1
    Circle(25, 25, Radius-zoom, RGB(Random(255), Random(255), Random(255)))
  Next
  zoom-1
  If zoom<0
    zoom=25
   
    EndIf
  StopDrawing()
 
  DisplayTransparentSprite(spx,50+ss,cS,255)
  StartDrawing(ScreenOutput())
  zoom+1
  For x=1 To 100
    For y=1 To 80
      col=Point(x,y)
      If col>0
        pos(x,y)=(col)
      Else
        pos(x,y)=0
      EndIf
    Next
  Next
  StopDrawing()
  ClearScreen(0)
EndProcedure

Procedure ToUDG()
 
  StartDrawing(ScreenOutput())
 
  For x=1 To 100
    For y=1 To 80
      ;StartDrawing(SpriteOutput(0))
      col=pos(x,y)
      ;StopDrawing()
      If col>0
        ;  FlipBuffers()
        Box(x*8,y*8,8,8,col)
        ;  FlipBuffers()
      EndIf
    Next
  Next
  StopDrawing()
 
EndProcedure
Repeat
  ClearScreen(0)
  MakeScreen()
  ToUDG()
  FlipBuffers()
  ExamineKeyboard()
  WindowEvent()
Until KeyboardPushed(#PB_Key_Escape)

Now as you can see, I am trying to carry out brain surgery using a plunger and a hacksaw - I need to be guided how I can do this sort of stuff with the framebuffer, possibly tinyptc because it seems so quick!

I've attached an exe for you to see if your not a Pb-er..

Thanks in advance!

:)

4
Purebasic / Help with Yabsic converting
« on: January 08, 2014 »
I am trying to convert some copper bars by Jim to PB (source is here : http://www.dbfinteractive.com/forum/index.php/topic,752.0.html) , however, Yabasic has a bitwise compare and I cannot work out the PB alternate.

Code: [Select]
; 'twisty fatty shrinky barry thing, with copper bars
; 'by Jim 18/10/2006
sw=640
sh=480
hsw=sw/2
;open window sw,sh
OpenWindow(0,100,100,640,480,"") : InitSprite()
OpenWindowedScreen(WindowID(0),0,0,640,480)


;';twisty barry thing stuff
ascale.f=3.14/180
w.f=100
inc.f=0
iinc.f=0.01
Dim c(4,3)
c(0,0)=255:c(0,1)=0:c(0,2)=0
c(1,0)=0:c(1,1)=0:c(1,2)=255
c(2,0)=0:c(2,1)=255:c(2,2)=0
c(3,0)=255:c(3,1)=255:c(3,2)=0
c(4,0)=c(0,0):c(4,1)=c(0,1):c(4,2)=c(0,2)

;'copper bar stuff
Dim cuy.f(3)
Dim cui.f(3)
Dim RGBc.f(3)
cuy(0)=0:cuy(1)=0:cuy(2)=0
cui(0)=0.005:cui(1)=0.007:cui(2)=0.012
cuh=80


Repeat
;setdispbuf
d=1-d
;setdrawbuf d
ClearScreen(0)

StartDrawing(ScreenOutput())
For y=0 To sh-1
RGBc(0)=0
RGBc(1)=0
RGBc(2)=0
For c=0 To 2
 
  If y>cuy(c) And y<cuy(c)+cuh
RGBc(c)=(cuh/2-Abs(y-cuy(c)-(cuh/2)))*(255/cuh)
EndIf

cuy(c)=cuy(c)+cui(c)

If cuy(c)>=sh-cuh Or cuy(c)<=0
cui(c)=-cui(c)
EndIf

Next

If RGBc(0)<>0 Or RGBc(1)<>0 Or RGBc(2)<>0
;  Debug "LineW"
;setrgb 1,RGBc(0),RGBc(1),RGBc(2)
Line(0,y,sw,y,RGB(RGBc(0),RGBc(1),RGBc(2)))
;Line(0,y,sw,y,#Red)
EndIf

Next


a=0
inc=inc+iinc
For y=0 To sh-100*Abs(inc)
x1 = w * (7+Abs(inc))/7 * Sin(a*ascale)
x2 = w * (7+Abs(inc))/7 * Cos(a*ascale)
x1=Abs(x1):x2=Abs(x2)
q=Int(a/90)

If q & 1<>0
;   If q <>0
  t = x1:x1 = x2:x2 = t
  EndIf

ow.f = hsw-((x1+x2)/2)
;setrgb 1,c(q+1,0),c(q+1,1),c(q+1,2)

Line(ow,y,ow+x1,y,RGB(c(q+1,0),c(q+1,1),c(q+1,2)))
;Line(ow,y,ow+x1,y,#Red)

;setrgb 1,c(q,0),c(q,1),c(q,2)

Line(ow+x1,y,ow+x1+x2,y,RGB(c(q,0),c(q,1),c(q,2)))
;Line(ow+x1,y,ow+x1+x2,y,#Red)
a=a+inc

If a<0 : a=a+360: EndIf

If a>=360 : a=a-360: EndIf

Next

If inc>2 Or inc<-2 : iinc=-iinc : EndIf
StopDrawing()
FlipBuffers()
Until quit=1
;
; sub copperbars()
; For y=0 To sh-1
; RGB(0)=0
; RGB(1)=0
; RGB(2)=0
; For c=0 To 2
; If y>cuy(c) And y<cuy(c)+cuh then
; RGB(c)=(cuh/2-Abs(y-cuy(c)-(cuh/2)))*(255/cuh)
; fi
; cuy(c)=cuy(c)+cui(c)
; If cuy(c)>=sh-cuh Or cuy(c)<=0 then
; cui(c)=-cui(c)
; fi
; Next
; If RGB(0)<>0 Or RGB(1)<>0 Or RGB(2)<>0 then
; setrgb 1,RGB(0),RGB(1),RGB(2)
; line 0,y,sw,y
; fi
; Next
; End sub

5
Purebasic / Worms Intro by emook
« on: January 07, 2014 »
Hi,

Just another little something I've been spending the evenings cobbling together. Thanks to KrazyK for the text-writing routine - why recreate something that has already been done well?

Sorry about the size 450kb, it just started to grow insize!

 ;)

6
Purebasic / My first intro!
« on: June 17, 2013 »
It's not much! But bloody hell, it only took me 15 years to finally make something!

https://www.dropbox.com/s/l03nybeaihj53g9/tunne_intro_final.rar

Thanks to Va!n for the tunnel tutorial


:)

Pages: [1]