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 - Pot Noodle

Pages: [1] 2
1
Challenges & Competitions / [Xmas_2013] Santas Party
« on: December 24, 2013 »
Hi guys,
It's been a rush and hard thinking but finally finished my Xmas 2013 Comp entry.
It's not up to much but I didn't have much time nor ideas  :-[
So enjoy and dance along with Santa OK.

2
Hi Guys,
I am hopping someone can clear this up for me.
I am using the scroll text routine that I found on here a long time ago, But I had to change the screen size in my program 1024 x 768
now I get an out of bounds error with my font array as I changed the For/Next loop

Here is the code that would produce the error.

Code: [Select]
Repeat
StartDrawing (ScreenOutput())
  ;DrawImage (UseImage(font),0,0)
cco=0

For cc=0 To 32
letter=(Asc(Mid(t$,tptr+cc,1))-31)   ; Debug output: letter = -31 out of bounds!

DrawImage(UseImage(gfxfont(letter)),(sco+cco),300+50*Sin((cc+cco+sco+m)/120)) 
cco=cco+32
Next
m=m-5
  sco=sco-3
  If sco<-32
  tptr=tptr+1
  sco=sco+32
  EndIf
  If tptr>(Len(t$)-30 )
  tptr=1
  EndIf
  StopDrawing()
ExamineKeyboard()
FlipBuffers()
ClearScreen(0)

Until KeyboardPushed (#PB_Key_Escape)

3
Information: scale_x and scale_y multiply the width and height of drawing commands where 0.5 will half the size of the drawing and 2.0 is equivalent to doubling the size.

This is my procedure i am using but it's not working right.

Code: [Select]
Procedure SetScale(Image, x.f, y.f)
   If ResizeImage(Image, ImageWidth(Image)*x, ImageHeight(Image)*y, #PB_Image_Smooth)
      ProcedureReturn 1
   Else
      ProcedureReturn 0
   EndIf
EndProcedure

Anyone shine a light on this  ;D

[Edit]

Sorted

4
General chat / Rip Amiga Savestate anyone
« on: September 04, 2013 »
Hi guys,

I am in the middle of trying to rip the flag anim from XJ220 but with no luck
I am not very good at it so i was wondering if anyone here could oblige

Thanks
 

5
Purebasic / Change a 2D Sprite Colour
« on: August 06, 2013 »
Just wondering if anyone knows how to change a sprite colour in PB
A 2D sprite that is, I guess messing with the memory in some way would service.
Any help would be great, Thanks.

6
Freebasic / Null.dll Missing
« on: February 25, 2013 »
Hi guys, Just installed FreeBasic on windows 7 pro with fbedit but every time I try and run anything I get Null.dll missing error
Should there be an Null.ddl library on my system? and if so is it just used by freebasic? or fbedit..
Thanks

7
Hi guys, I am hopping that some one can help me out with this effect.



I have been playing with this with out any joy.

Code: [Select]
Img = CreateImage(#PB_Any, #ResX, 240)
StartDrawing(ImageOutput(Img))
  For Y = 0 To 240
    R + 3 : G + 1 : b + 3
    LineXY(0, Y, #ResX, Y, RGB(R,G,b))
  Next
StopDrawing()

Thanks.

8
General coding questions / The need for speed!
« on: May 09, 2012 »
I will try and explain the problem to you

Car racing game, and i have the Rpm that when you press the up key goes from 0 to 55.
Then at the same time i need the Mph to go from 0 to 30.
It's when slowing down the car there is a problem as the Mph goes in to negative numbers before the Rpm reaches 0
I have tryed all sorts but i just can't sort it out.
Thanks for any help guys.

Code: [Select]
#Minimum_Rpm = 20
Global Gear = 1

Enumeration
  #Accelerate
  #Brake
  #SlowDown
EndEnumeration

Structure GearAccel
  GearUpAt.f                                                 ; RPM for next gear (up)
  GearDownAt.f                                               ; RPM for next gear (down)
  AccelUp.f                                                  ; RPM to add when accelerating
  AccelBreak.f                                               ; RPM to subtract when braking
  AccelDown.f                                                ; RPM to subtract when automatic slow down
  AccelDiff.f                                                ; RPM difference between gears
  SpeedUp.f                                                  ;
  SlowDown.f                                                ;
EndStructure

Global Dim GearTable.GearAccel(5)

; Init GearTable
GearTable(1)\AccelUp    = 0.5 : GearTable(1)\GearUpAt   = 50 ; change up at
GearTable(1)\AccelDown  = 0.5 : GearTable(1)\GearDownAt = 5  ; change down at
GearTable(1)\AccelBreak = 0.5 : GearTable(1)\AccelDiff  = 20 ; rpm between change
GearTable(1)\SpeedUp    = 0.1 : GearTable(1)\SlowDown  = 0.1

GearTable(2)\AccelUp    = 0.4 : GearTable(2)\GearUpAt   = 55
GearTable(2)\AccelDown  = 0.4 : GearTable(2)\GearDownAt = 15
GearTable(2)\AccelBreak = 0.4 : GearTable(2)\AccelDiff  = 20
GearTable(2)\SpeedUp    = 0.1 : GearTable(2)\SlowDown  = 0.1

GearTable(3)\AccelUp    = 0.3 : GearTable(3)\GearUpAt   = 60
GearTable(3)\AccelDown  = 0.3 : GearTable(3)\GearDownAt = 25
GearTable(3)\AccelBreak = 0.3 : GearTable(3)\AccelDiff  = 20
GearTable(3)\SpeedUp    = 0.1 : GearTable(3)\SlowDown  = 0.1

GearTable(4)\AccelUp    = 0.2 : GearTable(4)\GearUpAt   = 65
GearTable(4)\AccelDown  = 0.2 : GearTable(4)\GearDownAt = 35
GearTable(4)\AccelBreak = 0.2 : GearTable(4)\AccelDiff  = 20
GearTable(4)\SpeedUp    = 0.1 : GearTable(4)\SlowDown  = 0.1

GearTable(5)\AccelUp    = 0.1 : GearTable(5)\GearUpAt   = 70
GearTable(5)\AccelDown  = 0.1 : GearTable(5)\GearDownAt = 45
GearTable(5)\AccelBreak = 0.1 : GearTable(5)\AccelDiff  = 20
GearTable(5)\SpeedUp    = 0.1 : GearTable(5)\SlowDown  = 0.1

Procedure Transmission(accel)
 
  Shared Motor
 
  If accel = #Accelerate
    If Rpm >= GearTable(Gear)\GearUpAt And Gear < 5          ; Accelerate - Gear Up
      Rpm - GearTable(Gear)\AccelDiff
      Gear + 1
    Else
     
      Rpm + GearTable(Gear)\AccelUp                          ; Accelerate
      Mph + GearTable(Gear)\SpeedUp                         ; Speed up
       
      If Gear = 5 And Rpm > 50 : Rpm = 50 : EndIf
      If Gear = 5 And Mph > 30 : Mph = 30 : EndIf
     
    EndIf
  ElseIf accel = #Brake
   
    Rpm - GearTable(Gear)\AccelBreak                         ; Brake
    Mph - GearTable(Gear)\SlowDown                          ; Slow down
   
    If Rpm <= GearTable(Gear)\GearDownAt And Gear > 1        ; Brake - Gear Down
      Rpm + GearTable(Gear)\AccelDiff
      Gear - 1
    ElseIf Gear = 1
      If Rpm < #Minimum_Rpm : Rpm = #Minimum_Rpm : EndIf
      If Mph < #Minimum_Mph : Mph = #Minimum_Mph : EndIf
    EndIf
  Else
   
    Rpm - GearTable(Gear)\AccelDown                          ; Slow Down
    Mph - GearTable(Gear)\SlowDown
   
    If Rpm <= GearTable(Gear)\GearDownAt And Gear > 1        ; Slow Down - Gear Down
      Rpm + GearTable(Gear)\AccelDiff
      Gear - 1
    ElseIf Gear = 1                                          ; Slow Down - 1st Gear minimum Rpm
      If Rpm < #Minimum_Rpm : Rpm = #Minimum_Rpm : EndIf
      If Mph < #Minimum_Mph : Mph = #Minimum_Mph : EndIf
    EndIf
  EndIf
 
  ; Change the engine freq acording to Rpm
  SoundFrequency(Motor,Rpm*400)
  ; Return Mph
  ProcedureReturn Mph
 
EndProcedure

9
General coding questions / Convert RPM
« on: May 04, 2012 »
Hi Guys, Still playing around with this car game  ::) I have been sorting out the transmission.
But now that's all good I need a way to convert RPM to a usable floating point value.
The problem is that the RPM are high integers and my road speed is low floats like 0.1+
Can someone show me the light? Please.

Code + Sound Included in Zip.

10
General coding questions / Turning Corners
« on: April 10, 2012 »
Hi guys, I have been writing an old Amiga Arcade Style game.
But having got purspective right i am stuck with getting corners/bends, i think it's a case of offseting the scanlines
but i just can't sort it out, i have tryed to use an array for the X cords but this produces funny effects, any ideas guys
so i may carry on with it.
Thanks.

;-----------------------------------------------------------------
; Old Amiga Arcade Style Game.
;-----------------------------------------------------------------

If InitSprite()=0 Or InitKeyboard()=0 Or InitSound()=0
  MessageRequester("Error","Initializing Error!",0):End
EndIf

#ScrX=800:#ScrY=600:#ScrD=32
#ScanLines=200:#WidthStep=1
#LineWidth=1:#TotalLines=599

Global Dim ZMap.l(#ScanLines)
Global ScrollSpeed=10

For B=1 To #ScanLines
  ZMap(B)=B*10
Next

If OpenScreen(#ScrX,#ScrY,#ScrD,"")
  SetFrameRate(60)
;  background=CatchImage(#PB_Any,?back)
  Offset=100
  X=400
 
  Repeat
    FlipBuffers()
    ClearScreen(0)
    StartDrawing(ScreenOutput())
  ;  DrawImage(ImageID(background),0,0,830,336)
   
    ScreenLine=#TotalLines
    Distance=(290)
    A.f=1
   
    While A<#ScanLines
      If Mod(ZMap(Int(A))+Offset,150)>50
        GrasColor=$058303
        RoadColor=$3b3b3b
        LineColor=$3b3b3b
        SideColor=$000099
      Else
        GrasColor=$057204
        RoadColor=$3a3a3a
        LineColor=$838582
        SideColor=$aaaaaa
      EndIf
     
      LineXY(X-Distance,ScreenLine,X+Distance,ScreenLine,RoadColor) ; road
           
      LineXY(0,ScreenLine,#ScrX-X-Distance,ScreenLine,GrasColor)     ; left grass
      LineXY(X+Distance,ScreenLine,#ScrX,ScreenLine,GrasColor)       ; right grass
                                                                      ; centre lines
      LineXY(X+(#LineWidth-Distance*0.02),ScreenLine,X+(#LineWidth+Distance*0.02),ScreenLine,LineColor)
                                                                      ; red+white side lines
      LineXY(X-Distance,ScreenLine,X-Distance+5.0,ScreenLine,SideColor)
      LineXY(X+Distance-5.0,ScreenLine,X+Distance,ScreenLine,SideColor)
     
      ScreenLine-1        ; decreas line/y by 1
      Distance-#WidthStep ; decreas the distance one line at a time
      A+A*0.02
    Wend
   
    StopDrawing()
    Offset+ScrollSpeed
    If Offset>=150
      Offset-150
    EndIf
    ExamineKeyboard()
  Until KeyboardPushed(#PB_Key_Escape)
EndIf
; FreeImage(background)
End
DataSection
;  back:IncludeBinary "back.bmp"
EndDataSection
 

11
General coding questions / Mouse pointer!
« on: March 08, 2012 »
Hi guys, can anyone tel me why when I exit a purebasic compiled exe program I have to right click to get pointer back?
is it a bug or is there a command like ShowMouse or something? I have missed.
Thanks

12
General coding questions / Old School Effect!
« on: February 20, 2012 »
Hi guy's, Hope you all forgive me but I am trashing my brain trying to think of the name for an old effect so I can find out a bit of info about it, It's like having an image in the background that you can't see until say you pass a font or something over it then you can see the image through the font, I remember a rainbow effect behind the font.
Just can't think what it's called as I will try and produce it in Purebasic.

Thanks for reading.

13
General coding questions / Fading away
« on: January 23, 2012 »
I have been playing with Pure-basic and I must say it's a step up from Blitzmax and I have got further in less time than I did with blitz, but having said all that I was wondering if some one could take a look at this and point me in the right direction, this is for volume fade "not very good" I know, But I would like to add screen fade to it as well.

 ;////////////////////////////////////////////
 ; Volume fade
 ;////////////////////////////////////////////
  ExamineKeyboard()
 
  If KeyboardPushed(#PB_Key_Escape) Or Exit=1
    If Time=3
      Volume=Volume-1
      ModuleVolume(iMod,Volume)
      Time=0
    Else
      Time=Time+1
    EndIf
    Exit=1
  EndIf

This is in my main loop witch exit's when volume reaches 0, Any Ideas?
Thanks.

14
General coding questions / predefined arrays
« on: January 14, 2012 »
Hi guys I was wondering if someone could help as I am using Blitzmax and I am reading data values in to an array
to create my sine wave,  but the values just don't work right, plus there seams to be a speed issue as well, here is
my code Thanks.

 Framework brl.GLMax2D
Import BRL.BMPLoader
Import BRL.Retro

SetGraphicsDriver GLMax2DDriver()

Const Xres:Int = 800
Const Yres:Int = 600

Global Image:TImage = LoadAnimImage("sfont16.bmp", 16, 16, 0, 59)
Global Fonts:TPixmap[] = Image.pixmaps

Global Scrlpos:Int
Global Tpos:Int = 1
Global SineAdd:Int

Global Y1:Float[80]   ' Arrays for Sine values
Global Y2:Float[84]

Global Angle:Int   ' Array counter

Graphics(Xres, Yres, 32, GRAPHICS_BACKBUFFER)

glViewport 0, 0, Xres, Yres
glMatrixMode GL_PROJECTION
glLoadIdentity()
gluOrtho2D(0.0, Xres, 0.0, Yres)
glMatrixMode GL_MODELVIEW
glLoadIdentity

Global Scrolltext:String = "                                                     "
Scrolltext:+"this is my opengl sine wave scroll text routine this was part "
Scrolltext:+"written for me on the dbf forum by raizor and shockwave..  wrap! "
Scrolltext:+"                                                                    "
Scrolltext = Upper(Scrolltext)
                                                            
Type FPS
   Global Counter, Time, TFPS
   Function Calc%()
      Counter:+1
      If Time < MilliSecs() Then
         TFPS = Counter
         Time = MilliSecs() + 1000
         Counter = 0
      EndIf
      Return TFPS
   EndFunction
EndType

RestoreData Data1
For Local a:Int = 0 To 79
   ReadData Y1[a]   '      Read values in to array for sine wave 1
Next

RestoreData Data2
For Local b:Int = 0 To 83
   ReadData Y2   '      Read values in to array for sine wave 2
Next

Repeat

   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
   glEnable(GL_TEXTURE_2D)
   glPushMatrix()
   glLoadIdentity()
   
   GLDrawText("FPS: " + FPS.Calc(), 20, 20)

   SineAdd:-3
   Scroller()
   
   glPopMatrix()
   Flip(-1)
   
Until KeyDown(KEY_ESCAPE)

EndGraphics
End

Function Scroller()
   
   Local Drawpos:Int
   Local Textadd:Int
   Local Letter:Int
   Local Font:Int
   
   Scrlpos:+2
   
   glColor4f(1, 1, 1, 1)
   
   If Scrlpos > 16 Then
      Scrlpos = Scrlpos - 16
      Tpos = Tpos + 1
      If Tpos > Len(Scrolltext) - 52 Then Tpos = 1
   End If
            
   Drawpos = (-16) - Scrlpos

   Repeat
   
   If Scrlpos > 15 Then
      Angle:+1
      If Angle = 84 Then Angle = 0
   End If

   
      Letter = Asc(Mid(Scrolltext, (Tpos + Textadd), 1)) - 32
      Font = GLTexFromPixmap(Fonts[Letter])
      glBindTexture(GL_TEXTURE_2D, Font)
      
      ' Old Methods   
      'YCord1 = (Yres / 2) + (40 * Sin(SineAdd + Drawpos))
      'YCord2 = (Yres / 2) + (40 * Sin(SineAdd + Drawpos) + 16)
      
      glLoadIdentity()
   
      glBegin(GL_QUADS)
         glColor4f(0.2, 0.2, 1, 1)                              ' Blue Colour
         glTexCoord2f 0, 1; glVertex3f 0 + Drawpos, 0 + Y1[Angle], 0       ' Bottom Left
         glTexCoord2f 1, 1; glVertex3f 16 + Drawpos, 0 + Y2[Angle], 0     ' Bottom Right
         glColor4f(1, 1, 1, 1)                                 ' White Colour
         glTexCoord2f 1, 0; glVertex3f 16 + Drawpos, 16 + Y2[Angle], 0   ' Top Right
         glTexCoord2f 0, 0; glVertex3f 0 + Drawpos, 16 + Y1[Angle], 0     ' Top Left
      glEnd
         
       Textadd:+1
      Drawpos:+16

   Until Drawpos >= Xres

End Function

#Data1
DefData 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319
DefData 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339
DefData 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319
DefData 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, 300, 299

#Data2
DefData 375, 378, 381, 384, 387, 390, 393, 396, 399, 402, 405, 408, 411, 414, 417, 420, 423, 426, 429, 432, 435, 438, 441, 444, 447, 450, 453, 456, 459, 462, 465, 468, 471, 474, 477, 480, 483, 486, 489, 492, 495, 498
DefData 498, 495, 492, 489, 486, 483, 480, 477, 474, 471, 468, 465, 462, 459, 456, 453, 450, 447, 444, 441, 438, 435, 432, 429, 426, 423, 420, 417, 414, 411, 408, 405, 402, 399, 396, 393, 390, 387, 384, 381, 378, 375

15
General coding questions / Re: 3D Text in OpenGL
« on: January 08, 2012 »
Raizor did ever manage to sort your Opengl Sine/3D problem out ?
I am trying to create a sinus scroller using Opengl my self, the 3D effect is not important but having the letters them self's
flex in a sine wave not just up and down, if you can let me know if you managed it and how.
Thanks

 

16
General coding questions / Textured Fonts
« on: January 06, 2012 »
Anyone got some idea how textured fonts are laid out due to size, as I would like to be able to use different size fonts in my scroll routines like 16x16 32x32 and so on, is there a program that can lay em out for you?
any help appreciated.

 

17
General chat / Can't Download from DBF
« on: November 14, 2011 »
Hi guys anyone having probs downloading from here? it's strange I am using Firefox 8.0 and every time I click on a .rar file
the download requester pops up asking me if I want to run or save "Index.php", I have tryed other sites but it seams ok with  them, thanks for any ideas.

18
General coding questions / FreeBasic IDE
« on: October 23, 2011 »
Hi Guys, I am playing around with FreeBasic and FBide, I was wondering if anyone can surgest a better IDE.
Thanks
 

19
General coding questions / Sinewave Help Please
« on: September 11, 2011 »
Hi, I was wondering if some one could help me with this problem I have?
I have a routine that Shockwave knocked up for me to draw a sinewave scroller.
It works great but now I would like to make some changes to it and as maths is not
my strong point I once again find my self stuck again!

I have been trying to get the sinewave to randomly change like on some of the old
Amiga demos Amplitude change and so on, god this is hard to explain  :-[
Here is my code for the scroller.

Function Do_Scroller()
   
   ScrlPos:+2
   
   If ScrlPos > 16 Then
      ScrlPos:-16
      Textpos:+1
      If Textpos > Len(ScrollText) - 52 Textpos = 1
   End If
   
   Local DrawPos:Int
   Local TextAdd:Int
   Local Letters:Int
   
   TextAdd = 0
   DrawPos = (-16) - ScrlPos
      
    Repeat
      Letters = (Asc(Mid(ScrollText, (Textpos + TextAdd), 1)) - 32) * 16
      For Local IL:Int = 0 To 15
         DrawImage Font, DrawPos + IL, 300 + (70 * Sin(Sineadd + DrawPos + IL)), Letters + IL
      Next
      TextAdd:+1
      DrawPos:+16
   Until DrawPos >= xRes
   
End Function

Thanks for any help.

20
General coding questions / Old Amiga Effect Please
« on: September 03, 2011 »
Hi Guys, was wondering if anyone can help with this effect I have been trying to produce.
I can remember doing this years ago with AMOS Pro and it was easy to do then
But now I am using BlitzMax and I am wondering if it is even possible with Blitz!
I have attached a pic to show you what I mean, It's the colour in the background showing through the font
I have tried SetMaskcolor() but it kind of works but I can still see the background on screen.
Thanks

Pages: [1] 2