Advanced game related topics
SPH
Enthusiast
Posts: 268 Joined: Tue Jan 04, 2011 6:21 pm
Post
by SPH » Thu Jan 07, 2021 4:23 pm
I did this in 2006 but I haven't shown it much :
(Left Mouse Button to change)
Code: Select all
; SPH(2006)
; PB4
InitSprite()
InitMouse()
InitKeyboard()
;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS )
If ExamineDesktops()
dw.w=DesktopWidth(0)
dh.w=DesktopHeight(0)
Else
dw.w=1024
dh.w=768
EndIf
dw2=dw/2
dh2=dh/2
dw1=dw/4
dw3=(dw/4)*3
OpenScreen(dw,dh,32,"")
;;;;;;;;;;;
;;;;;;;;;;;
autre:
rr1.f=Random(5)+Random(1000)/1000
rr2.f=Random(5)+Random(1000)/1000
vv1.f=Random(5)+Random(1000)/1000
vv2.f=Random(5)+Random(1000)/1000
bb1.f=Random(5)+Random(1000)/1000
bb2.f=Random(5)+Random(1000)/1000
or1.f=rr1
or2.f=rr2
ov1.f=vv1
ov2.f=vv2
ob1.f=bb1
ob2.f=bb2
cr1.f=0.001+Random(1000)/10000
cr2.f=0.001+Random(1000)/10000
cv1.f=0.001+Random(1000)/10000
cv2.f=0.001+Random(1000)/10000
cb1.f=0.001+Random(1000)/10000
cb2.f=0.001+Random(1000)/10000
a1.f=0.001+Random(1000)/35000
a2.f=0.002+Random(1000)/35000
a3.f=0.003+Random(1000)/35000
a4.f=0.001+Random(1000)/35000
a5.f=0.002+Random(1000)/35000
a6.f=0.003+Random(1000)/35000
;;;;;;;;;;;
Repeat ; Until xmouse<>xmouse2 Or ymouse<>ymouse2 Or KeyboardPushed(#PB_Key_All)
ExamineMouse()
xmouse=MouseDeltaX()/55 ; /x : x= sensibilité
ymouse=MouseDeltaY()/55 ; /x : x= sensibilité
;*****
ClearScreen(0)
StartDrawing(ScreenOutput())
;;;;;;;;;;;
For i=0 To dh-1
r1=63+Cos(rr1)*63
r2=63+Sin(rr2)*63
v1=63+Cos(vv1)*63
v2=63+Cos(vv2)*63
b1=63+Sin(bb1)*63
b2=63+Sin(bb2)*63
rr=r1+v1+b1
vv=r2+v2+b2
;LineXY(0,i,dw,i,RGB(b1+b2,r1+r2,v1+v2))
;LineXY(dw2,i,dw,i,RGB(b1+b2,r1+r2,v1+v2))
LineXY(dw2-rr,i,dw2+vv,i,RGB(r1+r2,v1+v2,b1+b2))
rr1+a1
rr2+a2
vv1+a3
vv2+a4
bb1+a5
bb2+a6
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2
or1+cr1
rr1=or1
or2+cr2
rr2=or2
ov1+cv1
vv1=ov1
ov2+cv2
vv2=ob2
ob1+cb1
bb1=ob1
ob2+cb2
bb2=ob2
;;;;;;;;;;;
StopDrawing()
;*****
FlipBuffers()
If MouseButton(#PB_MouseButton_Left)<>0
Goto autre
EndIf
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All)
End
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.73LTS - 32 bits
BarryG
Addict
Posts: 3320 Joined: Thu Apr 18, 2019 8:17 am
Post
by BarryG » Thu Jan 07, 2021 4:57 pm
Nice! Reminds me a bit of the "Ray of Hope 2" demo on Amiga (watch from 1:20) ->
https://youtu.be/EnPDc3bNPD4?t=80
How do you make it faster? I don't see any "Delay()" or such, so can it be made faster? Thanks.
SPH
Enthusiast
Posts: 268 Joined: Tue Jan 04, 2011 6:21 pm
Post
by SPH » Thu Jan 07, 2021 5:57 pm
To speed up, some parts would have to be converted to ASM
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.73LTS - 32 bits
Kwai chang caine
Always Here
Posts: 5353 Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France
Post
by Kwai chang caine » Fri Jan 08, 2021 5:56 pm
Nice thing
Thanks for sharing
The happiness is a road...
Not a destination
oreopa
Enthusiast
Posts: 281 Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.
Post
by oreopa » Fri Jan 08, 2021 7:50 pm
Im a total sucker for sinuses
Thx for sharing
Proud supporter of PB! * Musician * C64/6502 Freak
oreopa
Enthusiast
Posts: 281 Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.
Post
by oreopa » Fri Jan 08, 2021 7:54 pm
BarryG wrote: How do you make it faster? I don't see any "Delay()" or such, so can it be made faster? Thanks.
Code: Select all
;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS )
I guess this optional line is here in case it uses whole cpu
))) (or core/thread, whatever)
also..... "AMIGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH!"...
EDIT: Also could be faster with a sinus table(s), maybe... probably
Proud supporter of PB! * Musician * C64/6502 Freak
Mijikai
Addict
Posts: 1360 Joined: Sun Sep 11, 2016 2:17 pm
Post
by Mijikai » Fri Jan 08, 2021 9:23 pm
Nice effect :>
Denis
Enthusiast
Posts: 704 Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France
Post
by Denis » Sat Jan 09, 2021 11:12 am
Nice one (pas mal...)
A+
Denis
Olli
Addict
Posts: 1071 Joined: Wed May 27, 2020 12:26 pm
Post
by Olli » Sat Jan 09, 2021 5:51 pm
oreopa wrote: Im a total sucker for sinuses
I suppose Google Translate has a bug...
Tenaja
Addict
Posts: 1949 Joined: Tue Nov 09, 2010 10:15 pm
Post
by Tenaja » Sat Jan 09, 2021 5:58 pm
I haven't viewed it, but I'm guessing he means sinusoidal shapes. That's how I read it, based on the title...
oreopa
Enthusiast
Posts: 281 Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.
Post
by oreopa » Sat Jan 09, 2021 7:48 pm
Olli wrote: oreopa wrote: Im a total sucker for sinuses
I suppose Google Translate has a bug...
Hehe. I guess it sounds pretty odd
I'm no medical expert, but please, for heavens sake, DO NOT suck on other peoples sinuses... erm...
Indeed, I meant I like sinusoidal patterns.
PS: There should be a thread to collect the demo-like effects threads, there have been a few I recall... I might do it sometime
Proud supporter of PB! * Musician * C64/6502 Freak
Olli
Addict
Posts: 1071 Joined: Wed May 27, 2020 12:26 pm
Post
by Olli » Sat Jan 09, 2021 8:03 pm
SPH published a very beautiful effect since near 3 years (2018?).
@SPH if you remember your algo about a water mirroring effect, using horizontal sinus also, do not hesitate to add a subject here, about it.
Translate (real) : il y a 2/3 ans, tu as posté un effet miroir horizontal qui ressemblait à la surface de l'eau. Si tu t'en souviens, tu devrais l'ajouter dans un nouveau sujet aussi.
SPH
Enthusiast
Posts: 268 Joined: Tue Jan 04, 2011 6:21 pm
Post
by SPH » Sat Jan 09, 2021 8:22 pm
Olli wrote: SPH published a very beautiful effect since near 3 years (2018?).
@SPH if you remember your algo about a water mirroring effect, using horizontal sinus also, do not hesitate to add a subject here, about it.
Translate (real) : il y a 2/3 ans, tu as posté un effet miroir horizontal qui ressemblait à la surface de l'eau. Si tu t'en souviens, tu devrais l'ajouter dans un nouveau sujet aussi.
=>
http://xmas.free.fr/demo_dog.zip
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.73LTS - 32 bits
Olli
Addict
Posts: 1071 Joined: Wed May 27, 2020 12:26 pm
Post
by Olli » Sat Jan 09, 2021 9:09 pm
I run away ! (ever with sinus for oreopa !)
oreopa
Enthusiast
Posts: 281 Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.
Post
by oreopa » Mon Jan 11, 2021 9:40 am
lol
EDIT: unfortunately Bool breaks that code in newer pb.... (olli's code)
Nice one.
Proud supporter of PB! * Musician * C64/6502 Freak