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.


Messages - ~Ar-S~

Pages: [1] 2 3
1
Purebasic / Re: DemoCoding - Tunnel Effect
« on: April 28, 2019 »
I continue to fight and wish that someday there will be a few small steps forward in terms of my health.
Then I would like to create more tutorials.

Um, I'm sad to hear that you have health concerns.
I really hope your problems will get better.
Take care of you.

2
Purebasic / Re: DemoCoding - Tunnel Effect
« on: April 23, 2019 »
I almost missed that great tutorial. Thank you Mr Va!n
I know this topic is very old but the same tutorial for a dot tunnel would be great.
thank you for sharing your knowledge.

Here is just a little 5.70 compatible modification

Code: [Select]
; *************************************************************************************
; *   P r o j e c t :    T u n n e l - F x
; *************************************************************************************
; *
; *   Part7: Moving Tunnel:
; *   ---------------------
; *   This is the last turorial part, where we will try to get the tunnel fx more
; *   interesting while moving the tunnel, by using SIN().
; *
; *   Source and Tutorial (c) by Thorsten Will aka va!n
; *   All rights reserved.
; *
; *************************************************************************************


DisableDebugger

; -------- Init Code --------

lTextureSize.l  = 256
lScreenWidth.l  = 640
lScreenHeight.l = 480

Dim aTexture  (lTextureSize  , lTextureSize   )
Dim aDistance (lScreenWidth*2, lScreenHeight*2)
Dim aAngle    (lScreenWidth*2, lScreenHeight*2)
Dim aBuffer   (lScreenWidth  , lScreenHeight  )

; -------- Generating Mapping Texture --------

For x.l = 0 To lTextureSize -1
  For y.l = 0 To lTextureSize -1
    aTexture(x,y) = (x * 256 / lTextureSize) ! (y * 256 / lTextureSize)
  Next
Next

; -------- Generating Distance and Angle Table --------

dDistance.d = 32.0
dParts.d    =  0.5
         
For x = 0 To lScreenWidth*2 -1     
  For y = 0 To lScreenHeight*2 -1
    aDistance(x,y) = Int(dDistance * lTextureSize / Sqr( (x-lScreenWidth) * (x-lScreenWidth) + (y-lScreenHeight) * (y-lScreenHeight) )) % lTextureSize
    dAngle.d = (dParts * lTextureSize * ATan2(y-lScreenHeight, x-lScreenWidth) / #PI)
    aAngle(x,y) = Int (256 - dAngle) & 255
  Next
Next

; *************************************************************************************

InitSprite()

OpenWindow(0,0,0,lScreenWidth,lScreenHeight,"",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,lScreenWidth, lScreenHeight,0,0,0,#PB_Screen_WaitSynchronization )

dSpeedX.d = 1.0
dSpeedY.d = 1.0

Repeat
  ; ------- Stuff for doing the animation -------
 
  dAnimation.d = dAnimation.d + 0.005
 
  lShiftX.l = Int(lTextureSize * dSpeedX.d * dAnimation.d)
  lShiftY.l = Int(lTextureSize * dSpeedY.d * dAnimation.d)

  lLookX = lScreenWidth /2 + Int(lScreenWidth /2 * Sin(dAnimation * 4.0 ))
  lLookY = lScreenHeight/2 + Int(lScreenHeight/2 * Sin(dAnimation * 6.0 ))

  ; -------- Calculate Texture coordinates and draw Tunnel -------

  StartDrawing(ScreenOutput())
    For y = 0 To lScreenHeight-1
      For x = 0 To lScreenWidth -1
        lCoordinateX.l = (aDistance(x+lLookX, y+lLookY) + lShiftX) % lTextureSize     
        lCoordinateY.l = (aAngle   (x+lLookX, y+lLookY) + lShiftY) % lTextureSize     
        aBuffer(x,y) = aTexture (lCoordinateX.l , lCoordinateY.l)
        Plot(x, y, RGB(0, 0, aBuffer(x,y) ))
      Next
    Next
  StopDrawing()

  FlipBuffers()
Until GetAsyncKeyState_(#VK_ESCAPE)

; *************************************************************************************

3
Purebasic / Re: 3D Starballs Library
« on: April 23, 2019 »
Hey.
Thanks.
I try it with PB 5.70 x64 and it works fine.
There is just a problem in the code. The KK_StarBallInfo() do not work, i ; it

4
Purebasic / [GAME] Free PB game
« on: November 16, 2018 »
BGames team's (Pollux, Yukin et Djes from the french forum) offers to us all their games until LJ3 made with PB



I let you see all content.
https://www.purebasic.fr/french/viewtopic.php?f=2&t=17499

PB forever  :updance:

5
I recoded all the size settings to make the game compatible with lower resolutions.
Could you try again KrazyK ?

6
Hehe Great Job. :clap: And nice bloody's...  :kewl:
Witch language to do this demo ?

7
Purebasic / Re: Old School Style Demo
« on: October 30, 2018 »
Very nice and proper.
I so like le little blink on the logo  ;D

8
Purebasic / Re: Psygnosis Agony MinIntro
« on: October 30, 2018 »
I love that forum  :cheers:

9
Purebasic / Re: Beast Tribute
« on: October 30, 2018 »
Veryyyyy nice.
I already saw a beast demo but not as complete as yours.
Really great job.
Thanks a lot for sharing.

10
Here is GHOST N PUMPKIN my small contest game

Some days to make... everything.
The collision tests are a little crappy... That makes the game harder  O0

Coded with PUREBASIC for windows x86 / x64

Windows Only

Press SPACE to START
Press ARROWS to MOVE
Press SPACE to FIRE during game
Press ESCAPE to EXIT

Special thanks to Boby from the french purebasic forum

EnJoY

-----EDIT------

Zip Update.
A have change a small value witch make a few gamer go to game over directly after start the game (i meet 2 people with that prob)

11
 :|| Great work !
Amazing GFX !

12
Yop yop.. i'll try to do something.. But no much time..

13
Purebasic / Re: PLATOO! A tiro skeet game (Demo)
« on: April 03, 2018 »
I've uploaded to purebasic official forum and everybody was so scared of an .exe... really piss me off and quit my wishes to coding for purebasic...  probably won't work on it anymore, just wanted to share and read some opinions so thanks again!
That's true..
If you haven't post a lot's of code before, they will be very paranoiac ^^ (do you post it to Annoncement ?)
But don't stop coding in PB for that. It's a good and fun language.
Cya

14
Purebasic / Re: ICS cracktro remakes
« on: April 03, 2018 »
Thanks ! :clap:
With the sources that could be much interresting  ;D

15
Purebasic / Psygnosis Agony MinIntro
« on: March 17, 2018 »
This is a small intro  to pay tribute to PSYGNOSIS and the superb AGONY on AMIGA. The most difficult was to recover and divert the SPRITES.
The archive contains some of the images (sprites and mod are in datasection), the code, the images.

Use Arrows to move the Owl.

EnJoY

16
Purebasic / Re: [Retroremake] Amstrad CPC for fun
« on: March 03, 2018 »
Thanks padman. It working with 5.62 x86 (but invalid access mem to the callFunctionFast with x64)  :clap:

17
Purebasic / Re: [Retroremake] Amstrad CPC for fun
« on: February 12, 2018 »
Please add all libs needed in your zip...

18
Purebasic / Re: PLATOO! A tiro skeet game (Demo)
« on: February 12, 2018 »
It works fine. Fun game. A bit of lag with High Dpi Mouse to move the target (as usual in PB fulscreen with  that kind of mouse)..  :clap:

19
Purebasic / 2D Metaballs
« on: April 06, 2017 »
Here is a great code From Shadoko (french PB Forum)
Note : Disable Debugger before launching

EnJoY   :cheers:

Code: [Select]
; demo 2d metaballs - pf shadoko -2016

EnableExplicit

Procedure.l ColorBlend(c1.l, c2.l, m.f)
    Protected r.w,g.w,b.w,a.w
    r=  Red(c1) + (Red(c2)     - Red(c1)) * m
    g=Green(c1) + (Green(c2) - Green(c1)) * m
    b= Blue(c1) + (Blue(c2) -   Blue(c1)) * m
    a=Alpha(c1) + (Alpha(c2) - Alpha(c1)) * m
    ProcedureReturn  RGBA(r,g,b,a)
EndProcedure

Procedure.l HSLToRGB(hue, saturation, lightness, alpha=0)
    Protected.f h=hue *6/256
    Protected.f s=saturation/255
    Protected.f l=lightness/255
    Protected.f c,x,r_,v_,b_,m
    c=(1-Abs(2*l-1))*s
    x=c*(1-Abs(Mod(h, 2) -1))
    Select Int(h)
        Case 0:r_=c:v_=x
        Case 1:r_=x:v_=c
        Case 2:v_=c:b_=x
        Case 3:v_=x:b_=c
        Case 4:r_=x:b_=c
        Case 5:r_=c:b_=x
    EndSelect
    m=l-c/2
    Protected r,v,b
    r=Int((r_+m)*255)
    v=Int((v_+m)*255)
    b=Int((b_+m)*255)
    ProcedureReturn RGBA(r,v,b,alpha)
EndProcedure

Procedure.l cola(col,a=$ff)
    ProcedureReturn col|(a<<24)
EndProcedure

Macro copyimagetosprite(im,sp)
    CreateSprite(sp,ImageWidth(im),ImageHeight(im),#PB_Sprite_AlphaBlending)
    StartDrawing(SpriteOutput(sp))
    DrawingMode(#PB_2DDrawing_AllChannels)
    DrawAlphaImage(ImageID(im),0,0)
    StopDrawing()
EndMacro

Procedure min(a,b)
    If a<b:ProcedureReturn a:Else:ProcedureReturn b:EndIf
EndProcedure

Procedure max(a,b)
    If a>b:ProcedureReturn a:Else:ProcedureReturn b:EndIf
EndProcedure

;====================================================================================
Structure sballe
    x.f
    y.f
    dx.f
    dy.f
EndStructure

Global nb=15    ; nombre de balle
Global relief   ; relief (granulosité)
Global dangle.f ; vitesse rotation lumiere
Global di=500   ; largeur image
Global dj=400   ; hauteur image
Global zoom=2   ; zoom
#delais=60*3    ; delais entre changement couleur/relief (en 60eme de seconde)
#delta=64-1     ; largeur balle (+zone d'influence)
#lim=#delta/2

Global Dim b.sballe(nb)
Global Dim reflet.l(255,255)
Global Dim balle.l(#delta*2+1,#delta*2+1)
Global Dim conv.l(32767)
Global Dim angle.w(2047)
Global Dim couleur.l(2)
Global Dim acouleur.l(2)
Global Dim rnd.f(31)

InitSprite()
InitMouse()
InitKeyboard()

Procedure couleurMAJ(v.f)
    Macro lum(x,y,r,nc,a=$ff)
        c=colorblend(acouleur(nc),couleur(nc),v)
        ResetGradientColors()
        GradientColor(0.0,cola(c,a))
        GradientColor(0.2,cola(c,a*0.5))
        GradientColor(1.0,cola(c,0))
        CircularGradient(x,y,r)
        Circle(x,y,r)
    EndMacro
    Static angle.f=1:angle+dangle
    Protected i,r,l,x,y,c,agx.f,agy.f
    StartDrawing(ImageOutput(0))
    DrawingMode(#PB_2DDrawing_AllChannels)
    Box(0,0,256,256,0)
    DrawingMode(#PB_2DDrawing_Gradient|#PB_2DDrawing_AlphaBlend )
    lum(128,128,200,0)
    For i=0 To 15
        agx=angle*rnd(i+0)
        agy=angle*rnd(i+16)
        x=128+80*Sin(agx)
        y=128+80*Sin(agy)
        lum(x,y,40,i % 2+1)
    Next
    CopyMemory(DrawingBuffer(),@ reflet(0,0),256*256*4)
    StopDrawing()
EndProcedure

Procedure initparam()
    Protected i,j
    Protected.f v,d,x,y
    dangle=Random(1)*0.02
    relief=Random(2)*6
    #taille=10:#dmax=#delta/#taille
    For i=0 To #delta*2-1:For j=0 To #delta*2-1
            x=(i-#delta)/#taille
            y=(j-#delta)/#taille
            d=Sqr(1.0+x*x+y*y)
            If d<#dmax:v=0.05*Pow(#dmax*#dmax-d*d,3)+Random(relief):Else:v=0:EndIf
            balle(i,j)=v
    Next:Next
   
    For i=0 To 2:acouleur(i)=couleur(i):couleur(i)=HSLToRGB(Random($ff),$ff,63+128*Bool(i)):Next
       
    For i=0 To ArraySize(conv()):v=200.0*Log(i-1000):If v<0:v=0:EndIf:conv(i)=v:Next
   
    For i=-1024 To 1023:angle(i+1024)=ATan2(1,i/50)*256/#PI+128:Next   
   
EndProcedure

Procedure RenderFrame()
    Static cpt:cpt+1:If cpt=#delais:cpt=0:initparam():EndIf
    Protected Dim bmp.l(dj-1,di-1)
    Protected Dim t.w(di-1,dj-1)
    Protected i,j,k,x,y,t00,rx,ry
    ExamineKeyboard()
    couleurMAJ(cpt/#delais)
    For k=0 To nb
        With b(k)
            \x+\dx:If \x<#lim Or \x>di-#lim:\dx=-\dx:EndIf
            \y+\dy:If \y<#lim Or \y>dj-#lim:\dy=-\dy:EndIf
            For j=max(\y-#delta,0) To min(dj-1,\y+#delta)
                For i=max(\x-#delta,0) To min(di-1,\x+#delta)
                    x=i-\x+#delta
                    y=j-\y+#delta
                    t(i,j)+balle(x,y)
                Next
            Next
        EndWith
    Next
   
    For j=0 To dj-1
        For i=0 To di-1
            t(i,j)=conv(t(i,j))
        Next
    Next
   
    For j=0 To dj-2
        For i=0 To di-2
            t00=t(i,j)
            If t00
                rx=angle(t(i+1,j)-t00+1024)
                ry=angle(t(i,j+1)-t00+1024)
                bmp(j,i)=reflet(ry,rx)
            EndIf
        Next
    Next
    StartDrawing(SpriteOutput(0))
    CopyMemory(@bmp(0,0),DrawingBuffer(),di*dj*4)
    StopDrawing()
   
    DisplaySprite(10,0,0)
    DisplayTransparentSprite(0,0,0)
    If KeyboardReleased(#PB_Key_Escape):End:EndIf
EndProcedure

Procedure init()
    Protected i,j,x,y,r,c
   
    OpenWindow(0,0,0,di* zoom,dj* zoom,"",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
    OpenWindowedScreen(WindowID(0),0,0,di,dj,1,0,0)
    CreateSprite(0,di,dj,#PB_Sprite_AlphaBlending)
    CreateImage(0,256,256,32,#PB_Image_Transparent)
    CreateImage(1,di,dj,32,#PB_Image_Transparent)
   
    ; image de fond
    StartVectorDrawing(ImageVectorOutput(1))
    VectorSourceColor(cola(Random($ffffff)))
    FillVectorOutput()
    For i=0 To di Step 20
        For j=0 To dj Step 20
            x=i+Random(20)
            y=j+Random(20)
            r=5+Random(30)
            c=Random($ffffff)
            VectorSourceCircularGradient(x, y, r)
            VectorSourceGradientColor(cola(c,128),0.0)
            VectorSourceGradientColor(cola(c,64),0.8)
            VectorSourceGradientColor(cola(c,0 ),1.0)     
            AddPathCircle(x,y,r)
            FillPath()
        Next
    Next   
    StopVectorDrawing()
    copyimagetosprite(1,10)
   
    ; position et vitesse initial des balles
    For i=0 To nb:b(i)\x=Random(di-#lim*2,#lim):b(i)\y=Random(dj-#lim*2,#lim):b(i)\dx=(Random(1000)-500)/500:b(i)\dy=(Random(1000)-500)/500:Next
   
    ; coef mouvement des lumieres
    For i=0 To 31:rnd(i)=(Random(2000)-1000)/1000:Next

    initparam()
   
    Repeat:WindowEvent():RenderFrame():FlipBuffers(): ForEver
EndProcedure

init()

20
Purebasic / Re: PB 5.60 beta 2 on the place
« on: February 03, 2017 »
Beta 2 out.
Note that the 5.4x are LTS but 5.50 and more are none LTS so with new functions and with frequently updates.

Quote
who need gif Animation
It's always fun to use but the most important is the ImageFrame() lib. We can easily make an animation by adding frames to a sprite.
It's much easier than before.

Pages: [1] 2 3