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 - Ampli

Pages: [1]
1
Purebasic / New Twister
« on: July 03, 2026 »
Hello all!
Here is a new pile of shitty code from me.


Code: [Select]
;--------------------------
; MADE WITH PUREBASIC 6.40
; USING UBUNTU 26.04
; YEAR 2026
;--------------------------
; [SPAGHETTICODE]
; CODE=ALDENTE
;--------------------------
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
ImportC ""
setenv(name.p-utf8, value.p-utf8, overwrite.l)
EndImport
setenv("GDK_BACKEND", "x11", 1)
CompilerEndIf

InitSprite() : InitKeyboard() : InitSound()

OpenWindow(1, 0, 0, 800, 600, "TWISTER Summer Edition 2026", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(1), 0, 0, 800, 600, 0, 0, 0)
SetFrameRate(60)

LoadFont(1, "terminal", 44, #PB_Font_Bold)
LoadFont(2, "terminal", 12, #PB_Font_Bold)

Global Dim text.s(15)
text(0) ="_____._.___ .______   ____   ____     .___ .______  _____._.______  ._______  "
text(1) ="\__ _:|: __|:      \  \   \_/   /     : __|:      \ \__ _:|: __   \ : .___  \ "
text(2) ="  |  :|| : ||       |  \___ ___/      | : ||       |  |  :||  \____|| :   |  |"
text(3) ="  |   ||   ||   |   |    |   |        |   ||   |   |  |   ||   :  \ |     :  |"
text(4) ="  |   ||   ||___|   |    |___|        |   ||___|   |  |   ||   |___\ \_. ___/ "
text(5) ="  |___||___|    |___|                 |___|    |___|  |___||___|       :/     "
text(6) ="                                                                       :      "
text(7) ="                                                                              "
text(8) ="-============================================================================-"
text(9) ="-      THIS IS A SMALL AMIGA INSPIRED INTRO THAT I MADE IN PUREBASIC         -"
text(10)="-    I DIDENT KNOW WHAT TO CODE SO I WENT TO DBF FORUM AND FOUND MY OLD      -"
text(11)="-  TWISTER CODE, I TOOK THE CODE AND STARTED TO WRITE A NEW VERSION OF IT    -"
text(12)="-                                                                            -"
text(13)="-                                             HOPE YOU LIKE IT!     AMPLI-26 -"
text(14)="-============================================================================-"

CreateSprite(1, 3000, 64, #PB_Sprite_AlphaBlending); OVER SIZED I KNOW =P

Global M_PI.f = 3.1415

Global ScrollText$ = "        HELLO ALL! S . W . E . D . E . N SAYS HI TO ALL DBF'ERS, MADE A NEW TWISTER SUMMER EDITION 2026, HOPE YOU LIKE IT....     "
Global ScrollX.f = 800
Global Speed.f = 6
Global aa.f = 0

Global Dim CachedY2.f(800)
Global Dim CachedY3.f(800)
Global Dim CachedS.f(800)

Global x.l, s.f, amp.f, v1.f, v2.f, v3.f, v4.f
Global y1.f, y2.f, y3.f, y4.f
Global color1.l, color3.l, color4.l

Repeat
ExamineKeyboard()
Event = WindowEvent()

If StartDrawing(SpriteOutput(1))
Box(0, 0, 3000, 64, RGB(55, 55, 155))
DrawingFont(FontID(1))
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(ScrollX, 0, ScrollText$, RGB(127, 127, 255)) ; Yellow text
TextWidthVal = TextWidth(ScrollText$)
StopDrawing()
EndIf

ScrollX - Speed
If ScrollX < -TextWidthVal
ScrollX = 800
EndIf

aa + 0.05

ClearScreen(RGB(135, 55, 135))

StartDrawing(ScreenOutput())
For x = 0 To 799
s = Sin(aa + x / 250) * 128
amp = (Cos(x / 250) * (s / 175))

v1 = (aa + amp)
v2 = (aa + amp) + M_PI / 2
v3 = (aa + amp) + M_PI
v4 = (aa + amp) + M_PI + M_PI / 2

y1 = 300 + Cos(v1) * 100
y2 = 300 + Cos(v2) * 100
y3 = 300 + Cos(v3) * 100
y4 = 300 + Cos(v4) * 100

CachedY2(x) = y2
CachedY3(x) = y3
CachedS(x)  = s

color1 = RGB(127,127,255)
color2 = RGB(127,127,255)
color3 = RGB(55, 55, 155)

If y1 < y2
Line(x, y1 + s, 1, y2 - y1, color1)
EndIf
If y3 < y4
Line(x, y3 + s, 1, y4 - y3, color2)
EndIf
If y4 < y1
Line(x, y4 + s, 1, y1 - y4, color3)
EndIf
Next x
StopDrawing()

For x = 0 To 799
y2 = CachedY2(x)
y3 = CachedY3(x)
s  = CachedS(x)
If y2 < y3
SidHojd.f = y3 - y2
If SidHojd > 1
ClipSprite(1, x, 0, 1, 64)
TransformSprite(1, 0, 0,  1, 0,  1, SidHojd,  0, SidHojd)
DisplayTransparentSprite(1, x, y2 + s)
EndIf
EndIf
Next x

Define fontSize.i = 12
Define spacing.i = 5
CreateSprite(2,800,600,#PB_Sprite_AlphaBlending)

StartDrawing(SpriteOutput(2))
DrawingMode(#PB_2DDrawing_Transparent)
DrawingFont(FontID(2))

ta.f + 0.072 
For i = 0 To ArraySize(text())
tsin = -Abs(Sin(ta+i/5)*25)
DrawText(12,102+tsin+(i * ( fontSize + spacing )),text(i),#White)
Next

StopDrawing()

TransparentSpriteColor(2,RGB(0,0,0))
SpriteBlendingMode(4,8)
DisplayTransparentSprite(2,0,0)

Delay(1) : FlipBuffers()

Until Event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End






2
Purebasic / PB Twister
« on: August 19, 2019 »
Hello, I want to share my first code here with you. Nothing special but a huge step for me in coding.

Code: [Select]
; Written by Mikael 'Ampli' Johansson 2019
; Purebasic 5.71
; Enjoy it as I do =)

InitSprite()
InitKeyboard()

OpenWindow(1, 0,0,800,600,"DBF - Twister", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(1),0,0,800,600,0,0,0)
SetFrameRate(30)

Global M_PI.f = 3.1415

Repeat
  ExamineKeyboard()
  event = WindowEvent()
  ClearScreen(RGB(55,155,185))
 
  StartDrawing(ScreenOutput())
    For x = 0 To 799 Step 2
      aa.f  + 0.00015
      s.f = Sin (aa+x / 150) * 120
     
      amp.f = (Cos(x / 8000  ) * s/165)
     
      y1.f = 300 + Cos((aa + amp)                   ) * 157
      y2.f = 300 + Cos((aa + amp) + M_PI / 2        ) * 157
      y3.f = 300 + Cos((aa + amp) + M_PI            ) * 157
      y4.f = 300 + Cos((aa + amp) + M_PI + M_PI / 2 ) * 157
     
      If y1 < y2
        Line(x, y1+s, 1, y2 - y1, RGB(  127+s,   0,  127+s))
        Line(x, y1+s, 9, y2 - y1 , RGB(  255,   255,  255))
       EndIf
       If y2 < y3
         Line(x, y2+s, 1, y3 - y2, RGB(  127-s,   127-s,  0))
         Line(x, y2+s, 9, y3 - y2 , RGB(  255,  255,  255))
       EndIf
       If y3 < y4
         Line(x, y3+s, 1, y4 - y3, RGB(  127+s,   0,  100))
         Line(x, y3+s, 9, y4 - y3 , RGB(  255,   255,  255))
       EndIf
       If y4 < y1
         Line(x, y4+s, 1, y1 - y4, RGB(  0,   127+s,  75))
         Line(x, y4+s, 9, y1 - y4 , RGB(  255,   255,  255))
       EndIf
    Next
  StopDrawing()
 
 
  Delay(1) : FlipBuffers()
 
Until event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End

3
Projects / New XM
« on: August 17, 2019 »
Hello, I having fun with Milkytracker again.
I don't know what to do with it so I post it here for you to hear.
More can be done to it but more songs have be started  :bfuck2:

/Ampli

4
Thanks alot, I will look into it and see if I can get it to work.

5
Sorry for posting in this old Thread, Is it possible somehow to convert this 4klang usage to PureBasic Linux?

6
General chat / new tune from me.
« on: December 23, 2016 »
Hello all, I am working with Milkytracker again after many years. This tune sounds like my other Ampli tunes but who cares I like it anyway and it is fun to make them.

7
General chat / Re: Website Issues!
« on: July 06, 2014 »
welldone, Ampli says Hej Kompis.

8
Purebasic / Re: Wrapper for Jim's TinySIDLib
« on: September 16, 2010 »
Thanks alot jim.

9
Purebasic / Re: Wrapper for Jim's TinySIDLib
« on: September 16, 2010 »
This link dosen't work anymore. Does anyone have this wrapper to share?

10
GFX & sound / Re: Request for C64 music (SID)
« on: October 09, 2009 »
You GOT MAIL!

i can try to make something.


/Ampli

11
General coding questions / Re: MusicLine Question!
« on: December 13, 2008 »
just to play musicline songs under windows aint hard, i use xmplay for that and it works great. i was looking for a replayer to use for games/intros, i love that tracker and just wanted to track more tunes with it on my amiga 1200. if xmplay had a replayer for it it cant be impossible i think. we already have great SID replayers now.

Thanks for the answers.. :cheers:

12
General coding questions / Re: MusicLine Question!
« on: December 12, 2008 »
MusicLine editor, the tracker on amiga, i wanted to make tunes again with it on the real machine, but i also want to be able to use the tunes in own coded stuff on PC. any ideas howto? =)

13
General coding questions / MusicLine Question!
« on: December 12, 2008 »
Do any of you know a routine to play MusicLine songs from amiga on pc? ive been searching but failed to find any.

14
C / C++ /C# / Re: Linux
« on: November 19, 2008 »
i have kdevelop installed. dont know how to use it yet tho.

15
C / C++ /C# / Re: Linux
« on: November 19, 2008 »
Thanks for the tips. i will look at it now... i havent found any useful info for ubuntu about it. its much easier to find info for windows.hehe but i will try to survive on linux for a while.



16
C / C++ /C# / Linux
« on: November 19, 2008 »
Hi i just started to learn some c++ on linux. can someone give me some tips where i can find some info about linux API or something that shows how i can make a messagebox and open a window and such on linux. i tryed some on windows and it worked well but im more like a Ubuntu nerd for now. =)

17
Challenges & Competitions / Re: [2 BUTTON] Rollertube
« on: February 16, 2008 »
hehe, but it wont restart after Death. need to press escape to exit..and the gameover parts repeats playing..

18
Challenges & Competitions / Re: [2 BUTTON] Rollertube
« on: February 16, 2008 »
The gameplay is to slow.  :-*

19
I can win with an AREXX code. no problemas  :diablo:

20
General chat / Re: The Welcoming Comittee
« on: December 16, 2006 »
Thank you!

Pages: [1]