BBC BASIC for Windows
« 4 way ball crack game v1 »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:19pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: 4 way ball crack game v1  (Read 392 times)
RockOve
New Member
Image


member is offline

Avatar




PM


Posts: 7
xx 4 way ball crack game v1
« Thread started on: May 19th, 2016, 11:30pm »

Hi. here is my game. Anyone who know how to upload my parts to this code for demostrations purpose? (bmp files)

Code:
      install @lib$+"SPRITELIB"
      :
      if fn_initsprites(5) = 0 stop:rem five sprites is used. 0 to 4
      on close proc_exitsprites : quit
      on error on error off : proc_exitsprites : print 'report$ : end:rem dont use "run". close window, then run.
      rem loads sprites
      if fn_createspritefrombmp(0,"ball.bmp") = 0 error 0, "Cannot create sprite 0"
      if fn_createspritefrombmp(1,"brick1.bmp") = 0 error 0, "Cannot create sprite 1"
      if fn_createspritefrombmp(2,"brick1.bmp") = 0 error 0, "Cannot create sprite 2"
      if fn_createspritefrombmp(3,"brick2.bmp") = 0 error 0, "Cannot create sprite 3"
      if fn_createspritefrombmp(4,"brick2.bmp") = 0 error 0, "Cannot create sprite 4"
      :
      mode 20
      :rem background image     pos 0,0  1600 wide 1200 high
      *DISPLAY "background.bmp" 0,0,1600,1200
      :rem top n bottom track:(tubes) is "tracks"
      *DISPLAY "tubes.bmp" 250,30,1100,30:
      *DISPLAY "tubes.bmp" 250,1100,1100,30
      :rem left n right track
      *DISPLAY "tubes2.bmp" 70,0,30,1200
      *DISPLAY "tubes2.bmp" 1500,0,30,1200

      print tab(0,0);"mouse up and down. click to drop ball"
      : drop=false
      dim x%(5),y%(5)
      ball%=5
      dx%=1
      dy%=1

      off
      :rem repeat loop begins here
      repeat
        mouse mx%,my%,mb%:rem get mouse input
  
        if mb%<>0 drop=true
  
        if drop=false then
          x%(0)=mx%:rem ball
          y%(0)=my%:rem ball
          dx=(-1^rnd(10))*1:rem random +1 or -1
          dy=(-1^rnd(10))*1:rem random +1 or -1
        endif
  
        if drop=true then
          x%(0)=x%(0)+dx:rem ball is loose
          y%(0)=y%(0)+dy
        endif
  
  
        x%(1)=mx%-250:rem bottom bricks
  
        if x%(1)< 30 then x%(1)=30 :rem limits
        if x%(1)> 994 then x%(1)=994
        y%(1)=200:rem bottom bricks
        x%(2)= 1000-mx%:rem top bricks
        if x%(2)<30 then x%(2)=30:rem limits
        if x%(2)>994 then x%(2)=994:
        y%(2)=1150:rem rem top brick
  
        x%(3)= 30:rem left brics
        y%(3)=my%+250:rem left brics
        if y%(3)>1150 then y%(3)=1150:rem limits
        if y%(3)<582 then y%(3)=582:
  
        x%(4)=1380:rem right brics
        y%(4)=1150-my%+256
        if y%(4)>1150 then y%(4)=1150:rem limits
        if y%(4)<582 then y%(4)=582
  
        proc_movesprite(0,x%(0)-64,y%(0)+64,1):rem ball
        proc_movesprite(1,x%(1),y%(1),1):rem bottom brickwall, 1 is show,0 is hide
        proc_movesprite(2,x%(2),y%(2),1):rem topp brickwall
        proc_movesprite(3,x%(3),y%(3),1):rem left brickwall
        proc_movesprite(4,x%(4),y%(4),1):rem right brickwall
  
  
        rem if y%<
        if y%(0)<-38 or y%(0)>1212 or x%(0)<-38 or x%(0)>1600+38 then drop=false:rem ball out
        if y%(0)<238 and y%(0)>200 then
          rem did it hit a brickwall?
          if x%(0)>x%(1) and x%(0)<x%(1)+560 then dy=1
        endif
        :
        if y%(0)>960 and y%(0)<960+50 then
          if x%(0)>x%(2) and x%(0)<x%(2)+560 then dy=-1
        endif
        :
        if x%(0)<238 and x%(0)>200 then
          if y%(0)<y%(3) and y%(0)>y%(3)-560 then dx=1
        endif
        :
        if x%(0)>1350 and x%(0)<1350+50 then
          if y%(0)<y%(4) and y%(0)>y%(4)-560 then dx=-1
        endif
  
      until mb%=1:rem repate until right mouse button is pushed
      wait 100
      quit:rem closes output window
 
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: 4 way ball crack game v1
« Reply #1 on: May 20th, 2016, 08:21am »

Hi RockOve,

One possibility would be to compile your game to a standalone executable, making sure that it includes the bitmaps, and then post that somewhere. Options have recently been discussed on Ric's strand "3D Gaming Project" - have a look there. An obvious new candidate is the new Groups.io site.

Alternatively, could you make an additional routine that can generate them on the fly?

Best wishes,

D

User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls