October 18, 2019, 06:32:14 PM

Author Topic: Pure Basic  (Read 781 times)

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 357
    • FABERSGAMES
Pure Basic
« on: October 02, 2019, 11:22:28 AM »
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.
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Online Kris

  • Jr. Member
  • **
  • Posts: 71
Re: Pure Basic
« Reply #1 on: October 02, 2019, 03:26:59 PM »
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/


Offline Naughty Alien

  • Hero Member
  • *****
  • Posts: 652
Re: Pure Basic
« Reply #2 on: October 02, 2019, 04:25:35 PM »
..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..

Offline zxretrosoft

  • Jr. Member
  • **
  • Posts: 21
  • I apologize in advance for bad English
Re: Pure Basic
« Reply #3 on: October 06, 2019, 09:14:53 PM »
..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.

Offline 3DzForMe

  • Hero Member
  • *****
  • Posts: 726
Re: Pure Basic
« Reply #4 on: October 06, 2019, 09:33:31 PM »
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?

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 617
    • Cerberus X
Re: Pure Basic
« Reply #5 on: October 07, 2019, 06:52:17 AM »
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.

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 357
    • FABERSGAMES
Re: Pure Basic
« Reply #6 on: October 07, 2019, 12:07:36 PM »
I downloaded that book 2d games on purebasic or something and there was no charge . Thanks I'll take a look at it .
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 357
    • FABERSGAMES
Re: Pure Basic
« Reply #7 on: October 07, 2019, 01:23:09 PM »
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 .
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 357
    • FABERSGAMES
Re: Pure Basic
« Reply #8 on: October 08, 2019, 07:28:38 PM »
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 .
Code: [Select]
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
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 357
    • FABERSGAMES
Re: Pure Basic
« Reply #9 on: October 08, 2019, 09:38:34 PM »
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 .
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Online Kris

  • Jr. Member
  • **
  • Posts: 71
Re: Pure Basic
« Reply #10 on: October 08, 2019, 09:40:18 PM »
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. 

Code: [Select]
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)

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 357
    • FABERSGAMES
Re: Pure Basic
« Reply #11 on: October 08, 2019, 09:50:20 PM »
Thanks Kris I'll have another go . was getting a little despondent . Thanks
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 357
    • FABERSGAMES
Re: Pure Basic
« Reply #12 on: October 08, 2019, 10:26:53 PM »
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 .

 
Code: [Select]
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
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 357
    • FABERSGAMES
Re: Pure Basic
« Reply #13 on: October 09, 2019, 08:11:08 PM »
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 .
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Naughty Alien

  • Hero Member
  • *****
  • Posts: 652
Re: Pure Basic
« Reply #14 on: October 10, 2019, 01:45:43 AM »
..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..