10 February 2015, 20:46 | #1 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
[blitz basic] How much amiga-blitz friendly is this?
[note: i just got all pieces of amiblitz 2 and going to install it so am not ready yet]
found this tutorial for a Tetris clone on blitz basic PC: how much do i need to modify this to make it run on an amiga? (of course the 800x600 screen gotta go) bare-bones tetris clone example code Seems kinda straightforward but since is a long time i dont touch a basic and havent touched Blitz yet i want to make sure before to start work on it. Last edited by saimon69; 10 February 2015 at 20:46. Reason: typos |
11 February 2015, 18:54 | #2 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
[update]
ok, actually what i found is Blitz Basic 2: is the one to use or what version do you advice me? i remember hearing about using Amiblitz 2 rather than 3... |
11 February 2015, 22:04 | #3 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,377
|
By all means, go ahead and use BB2, just don't try to adapt PC source codes in it.
|
11 February 2015, 23:38 | #4 | |
Gets there in the end...
Join Date: Sep 2005
Location: Wales
Posts: 880
|
Quote:
But be prepared to do a fair bit of rewriting, especially where anything writes to the screen. And I replaced many of the functions eg drawboard() with labels eg .drawboard and used Gosub to call them but you then have to rearrange the variables especially if functions are using local variables. Blitz amiga does have statements and functions though too. |
|
12 February 2015, 03:05 | #5 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
Else, is there some tetris game written in BB2 amiga that i can take as reference to understand how to modify it to my needs?
|
12 February 2015, 23:25 | #6 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 482
|
I've written one couple of years ago, but the src is not public. What you need is: Look how tetris works and figure out how to do this by yourself. It is fairly simple. Why do you need the source "to modify it to [your] needs" instead of writing it all from scratch?
|
13 February 2015, 01:02 | #7 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
first because i dont know where to get my hands on to modify that source code: i guess the logic of handling arrays and collision is basically the same but display have no clue: i code in javascript actionscrtipt 1 and php and used zx basic but blitz is definitely different: did look for tutorials very base level but found little stuff so far
second, because my fnal purpose is to create a version of the old flashpoint arcade, that is based on tetris logic plus some little additions (now is more a beat the level game than a puzzle one) so having a working tetris base i could just add modifications - did it on a tetris flash so more or less i know what to add but lack basics to do it on blitz. |
17 February 2015, 22:28 | #8 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
ok i got rid of a biltz2 copy and started to get grip of the usage. So far i changed the set screen and the key control but now have some doubts about some functions and instructions used on that port.
First of all: are the read-data instructions used in the same way? second the instruction Code:
SeedRnd MilliSecs() then for instructions like cls, setOrigin etc. are already on blitz 2 or need to use other ones? |
19 February 2015, 10:35 | #9 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
Updates: i was able to make the BlitzOut AF tutorial run; had to write a separate program to generate the shapes though; this also made me understand that have a good deal of work to do in order to convert that tutorial in Amiblitz; will go on slowly and steadily..
|
19 February 2015, 21:34 | #10 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
ok so was pondering on what to do and i realized am using not the listing above but the more advanced one here:
tetris clone example code now i started to convert some of those functions in statements however some of the functions actually have parameter, like RotatePiece; how transfer parameters on a statement? Plus, am planning to use shapes and not drawn blocks: how much the logic might differ? |
19 February 2015, 22:21 | #11 | |||
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 482
|
Quote:
Forget SeedRnd, you don't need it. This is for internal use of the random number generator. Just replace the Code:
NextPiece = Rand(1, 7) Code:
NextPiece = RND(6)+1 Quote:
Code:
Function RotatePiece(rotateLeft = False) Code:
Statement RotatePiece{rotateLeft} Note: there is a Code:
If .... Then Return You can (for now) just replace the Return with Code:
Statement Return Quote:
Reason: You have to change the logic quite a bit. I would start to replace the little "DrawBlk" Function with a simple "Box", with adaptions for color, of course. this would speed up things a little bit if you after this. Last edited by Cylon; 28 February 2015 at 02:33. Reason: typos, misspellings and so on.. |
|||
19 February 2015, 22:59 | #12 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
@Cylon
sounds like homework ^^ |
20 February 2015, 23:27 | #13 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 482
|
No, not really. If you know Blitz a little bit then a little thinking gets you further.
* Don't use the RGB at all. Use Colors (one for each of the 7 tiles). * Put all the Functions (or Statements after "conversion") on top, right after init and variable declaration. The main routine follows (because you can only call Functions after they have been created). * If you don't want to screw up too much of the original src, you can go for a screen with the same dimensions, maybe with less colors (8 bit or less). Just make it autoscroll 800x600, the displays dimensions doesn't matter in that case. * Replace all GLOBAL on top with SHARED (Find&Replace), then encapsulate the whole GLOBALSHARED block with Code:
Macro myshared SHARED Endofgame ;example! . . End Macro Code:
Global CurPieceX = 3 becomes SHARED CurPieceX and later (or before, as we encapsulated the Globals into a macro) CurPieceX = 3 Code:
Function Foo {} !myshared . . End Function *Edit: Please note: You have DIMed some arrays, those Shares must be inside the myshared Macro too. The provided source is actually quite easy to convert to Blitzbasic2.... Last edited by Cylon; 25 February 2015 at 23:07. Reason: changes ?!? |
24 February 2015, 01:40 | #14 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
did not had time to work on it this weekend, will keep you posted
|
24 February 2015, 08:08 | #15 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
ok continued to work on the adaptation, now have a "garbage at end of line" error when the code reach an Origin statement like:
Code:
Origin OrigBoardX, OrigBoardY |
25 February 2015, 22:47 | #16 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 482
|
Ignore that ;-)
It means: "Origin" is not a known Command or whatever, if it is a label, then there is cr*p after it. It sets the origin coordinates for the following text statements. Add a ; in front of this line. Proceed adding ; in front of every text .... you encounter on the way. Dito with color ... As i said: Make it compile. Save all (big) steps into different file iterations. I've got mine compiling, btw. (started today 1:30 hrs ago). Last edited by Cylon; 25 February 2015 at 22:56. Reason: adds |
26 February 2015, 00:58 | #17 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
Well you got more experience, i feel like trying to make my horizons tape running on ZX spectrum for the first time (and it took a good while - talking on a week of attempts - due to volume and azimut settings)
|
26 February 2015, 10:48 | #18 |
J.M.D - Bedroom Musician
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,678
|
so now here i am with a Illegal Procedure Call concerning DrawBlk:
following the above syntax i modified it as DrawBlk{params} because with round braces was having syntax error... |
26 February 2015, 21:54 | #19 | |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 482
|
Quote:
All the Origin.... variables setting different areas which act as an origin(!) to the following drawing commands. I can surround this (as Blitz2 has no Origin cmd) by creating a Macro: Code:
Macro Origin xx=`1 yy=`2 End Macro Code:
Origin OrigBoardX, OrigBoardY Code:
!Origin {OrigBoardX, OrigBoardY} Code:
Line 0, 200, 400, 200, ... Code:
Line xx+ 0,yy+ 200,xx+ 400,yy+ 200, ... That way we get our Origin. It also only happens a few times, so it is not much work. |
|
26 February 2015, 22:06 | #20 | |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 482
|
Quote:
Example: Code:
If NOT DropPiece{} If NOT (return from)DropPiece{}. EDIT: (return from) indicates a spark in your mind, as a NOT expects an argument that is kindly delivered as a return value from a Function{} Last edited by Cylon; 18 April 2015 at 01:52. Reason: Try to teach something and avoid further misunderstandings |
|
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tutorials for Amiga Blitz Basic 2? | Kenan | support.Other | 2 | 19 July 2013 23:27 |
amiga and old blitz basic prog - please help | brian hills | support.Other | 7 | 05 October 2009 01:56 |
Wanting to learn Blitz Basic on real Amiga | Adropac2 | request.Other | 20 | 20 August 2008 07:30 |
blitz basic | petza | request.Apps | 11 | 08 April 2007 01:49 |
Blitz Basic 2 | LaundroMat | Retrogaming General Discussion | 5 | 24 July 2001 08:10 |
|
|