Pure Basic

Started by Pfaber11, October 02, 2019, 11:22:28

Previous topic - Next topic

Pfaber11

Just downloaded my free copy of pure basic . The free version can only be used for small programs but should be ok to learn on and see if I want to buy it. Had a play with it and seems like it's gonna take some time to get into it .I have had a brief look at it before but not in great detail . So far managed to open a window on the screen and that's where I'm at right now. The reason I would like to learn this is it apparently is very fast and compiles to machine code . Will still be developing with AGK classic for the foreseeable but just want to add another string to my bow and this seemed the obvious choice . If anybody has any tips or advice feel free to comment . I'm not planning on defecting from AGK any time soon.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Coder Apprentice

#1
Check out Jon P. Logsdon's book on programming 2D games for PureBasic. It's free. But as far as I know the main example game needs a full version of PureBasic. Honestly if you want to check PureBasic properly I suggest just buy it. It's really not that expensive and you have lifetime free upgrades. For 3D it comes with many examples.

What's good to keep in mind when you start with PB for game development, that it uses two separate engines for 2D and 3D. For 2D is a fairly simple DX9 sprite engine, no built in 2D physics. For 3D it uses Ogre3D 1.8 which is a fairly capable engine that has good backward compatibility with older DX9 level GPUs and uses Bullet for physics. But because they are two separate engines you can't mix their functions/commands. You either use one or the other. You'll find out fast that PureBasic is not geared towards game programming (nor any other specific area) so you'll have to do more manually and certain things won't be as "straight forward" as they're in AppGameKit. Knowing it's quirks is essential so using their forum where many issues had been discussed already is invaluable.

Compared to AppGameKit, PureBasic will give you more speed, control and freedom, but also more work, and decisions to make.

Programming 2D Scrolling Games for PureBasic
http://mycodeserver.com/games_books/


Naughty Alien

..PureBasic is fantastic..for me is a huge refresh as things simply works as advertised..all exporters needed for 3D are basically OGRE tools available easy and very stable...speed wise, is also, brilliant...after NF, this is next tool i really like a lot..

zxretrosoft

Quote from: Naughty Alien on October 02, 2019, 16:25:35
..PureBasic is fantastic..for me is a huge refresh as things simply works as advertised..all exporters needed for 3D are basically OGRE tools available easy and very stable...speed wise, is also, brilliant...after NF, this is next tool i really like a lot..

Yes, exactly. I agree. PureBasic is a great language, fast. For 79 € completely cool, I never regretted.

From my perspective, it has several reserves. E.g. does not have aggregated sprites or particles, completely physics commands (such as AGK), but otherwise it's a great language.

3DzForMe

Quote..PureBasic is fantastic..for me is a huge refresh as things simply works as advertised..all exporters needed for 3D are basically OGRE tools available easy and very stable...speed wise, is also, brilliant...after NF, this is next tool i really like a lot..

I'll put it on my list, if B3D stops doing the biz due to some Win 1* release. But W10 is the last ever Windows release..... right?
BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

MikeHart

It is surpose to be the last release, but the 6 months updates can have an impact. And in a way that an app might not function right.

Pfaber11

I downloaded that book 2d games on purebasic or something and there was no charge . Thanks I'll take a look at it .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

#7
Downloaded 3 books on pure basic to have a look at . Gonna take some time as quite thick but I will give it  a fair crack of the whip.
Pure Basic a beginners guide
Pure Basic reference manual
Learn to program_PB
Should keep me busy for a while . I believe the reference manual is over a thousand pages . By the way  all these books were free as is my version of pure basic . It'll do until or if I decide to start a project in it . Is the OGRE engine built into PB or do I need to download it separately . It may be that I'm not cut out for PB and if that happens to be the case I will stick with AGK2
. I'm into 3d games these days and this will be the direction I'm heading in . Hopefully what I've learnt from using AGK will be useful in PB. Anyway I'll let you know what I think and if I decide it's for me .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

Well I've had a play and have ground to a halt . can anybody tell me what's wrong with this code . The window is supposed to turn red but it doesn't .
InitSprite()

OpenWindow(1,200,200,400,400,"pauls program")
ClearScreen(RGB(100,0,0))
FlipBuffers()
Delay(5000)
StartDrawing(WindowOutput(1))

DrawText(10,10,"hello world")
StopDrawing()

FlipBuffers()
Delay(5000)

End
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

#9
well I know where I was going wrong I was using a window and screen at the same time or at least trying to. Thanks for reading.
edit
well I'm still moving on very slowly and am thinking of giving pure basic the elbow it's just so slow to get to grips with for me anyhow . Gonna give it a few more days and see how I feel .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Coder Apprentice

#10
You opened a window but didn't open a screen inside the window. You can put FlipBuffers() after StopDrawing() but it's not necessary in this case. 

InitSprite()
InitKeyboard()

OpenWindow(1,200,200,400,400,"Paul's program! Press Any Key To Exit!")
OpenWindowedScreen(WindowID(1),0,0,400,400)

Repeat
 
  WindowEvent()
  ExamineKeyboard()
  ClearScreen(RGB(100,0,0))
  StartDrawing(WindowOutput(1))
  DrawText(10,10,"hello world")
  StopDrawing()
 
Until KeyboardPushed(#PB_Any)

Pfaber11

Thanks Kris I'll have another go . was getting a little despondent . Thanks
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

Well I had a play around with that code and this is what I came up with . It's working that's the main thing .
learnt a few things this evening which is good .


InitSprite()
InitKeyboard()
OpenWindow(0,200,200,400,400,"Paul's program! Press Return To Exit!")
OpenWindowedScreen(WindowID(0),0,0,400,400)
  Loopy:
  ExamineKeyboard()
  ClearScreen(RGB(100,100,0))
  StartDrawing(WindowOutput(0))
  DrawText(10,10,"hello world")
  StopDrawing()
  WindowEvent()
  If  KeyboardPushed(#PB_Key_Return)
    End
  EndIf
Goto loopy
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

Well tonight I'm gonna get stuck into PB again and see if I can learn something new . Got a spare old note book and am going to dedicate it to PB so I don't forget anything . Gonna see if I can get some Graphics on the screen tonight and maybe get them moving about. Thanks again for all the help from the excellent people on this forum. Happy coding .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Naughty Alien

..here are some shots from provided samples...so much of 'touch' of old B3D, but this one is much faster and 3D engine is modern..

..Dynamic shadows, self shading, physics, collisions..




..bridge physics example with dynamic shadows and so on..




..physics responsive water surface..




..all of this runs on 4K display with over 120FPS no screen tearing or anything..super smooth..3D engine is fully embedded in to language, shader powered, with widely available tools to import media without any voodoo...very very nice..