|
Post by fl on Dec 12, 2012 7:52:09 GMT -5
***update of 06/27/2013***** the game is finished : crazycarscpc.free.fr/download/crazycarsGENESIS.bin************************ hello i'm french an i like making little games in basic language. (i know 3 basic : amstrad basic, qbasic , and qb64) i have just discovered that basic was possible on Genesis. woaw ! i want to test my games on on this great machine ! this basic don't look looks like the qbasic, so i need some help first : how to draw a line on screen ? i don't find in qbasic it was : LINE (100,50)-(200,100),2 for a draw line in color 2 LINE (100, 50)-(200, 100), 2, BF for draw a filled rectangle in color 2 how to do this with BasiEgaXorz ? thanks in advance and long life to the basic
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 12, 2012 10:44:12 GMT -5
There's no native way for BEX to draw a line or pixel, since everything is stored in 8x8 tiles. You'd need to write a routine that would dynamically alter the tile in VRAM.
|
|
|
Post by fl on Dec 12, 2012 12:13:43 GMT -5
thanks for your response. What a pity that the graphics function are not the same than basic ! it was so easy with "line"! so if i want to drawing some graphs, line by line, like a rectangle or a triangle, i have to do many difficult things ? bye
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 13, 2012 8:56:35 GMT -5
You would need to create the graphics using 8x8 pixel tiles (there's a few programs for this, or you can use dataint statements) and you can piece them together to make a graph, rectangle, etc., but everything will have to be predefined in the graphics aspect. You can use VDPRAMWRITE to place 2 pixels, but that's a little more advanced. What are you trying to do? Maybe someone can offer a different way to go about it
|
|
|
Post by fl on Dec 13, 2012 20:44:33 GMT -5
hello i want to convert one racing game, using the code of lou gorenfeld : www.extentofthejam.com/pseudo/i have already used this code in qb64 to do a remake of "crazy cars" (a game of the 80's computer). my remake : crazycarscpc.free.fr/indexEN.htmthis basic program is easy to convert, but road is drawed line after line. that's the problem !
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 13, 2012 23:02:41 GMT -5
Attached is a quick example on how to do that kind of effect on the MegaDrive. Attachments:
|
|
|
Post by fl on Dec 14, 2012 7:24:23 GMT -5
thanks for the example, i will work on it. i give you the code of the "engine" of my remake with arrows keys, you makes curves right or left i hope it's possible with BEX
SCREEN 13 ' (320x200)
' engine by F.L from lou gorenfeld example : http://www.gorenfeld.net/lou/pseudo/ ' to run with qb64 : http://www.qb64.net/
CONST RoadLines = 66 SpeedScroll = 5 CONST RoadY = -1 'arbitrary CONST ResX = 320 CONST ResY = 200 CONST PlrLine = 8 ' ?? horizon = 134 GrassColor = 2 RoadColor = 8
' Draw the road DIM X AS SINGLE DIM DX AS SINGLE DIM DDX AS SINGLE DIM HalfWidth AS SINGLE DIM SegY AS SINGLE
SegY = RoadLines DX = 0 DDX = -.05 ' angle of turn
' main loop
DO
HalfWidth = 160 ' width of road WidthStep = 2.3 ' inclination of the straight road
' keyboard input
IF _KEYDOWN(19712) THEN DDX = -.05 IF _KEYDOWN(19200) THEN DDX = .05
IF _KEYDOWN(20480) THEN SegY = SegY + 1 IF _KEYDOWN(18432) THEN SegY = SegY - 1
' limits of the turn
IF SegY < 0 THEN SegY = 0 IF SegY > RoadLines THEN SegY = RoadLines
' Set up the frame
X = 160 ' center of road
DX = 0 ' try 1 or -1 to change the side the road
ScreenLine = ResY - 1
FOR A = 1 TO RoadLines
' road
LINE (X - HalfWidth, ScreenLine)-(X + HalfWidth, ScreenLine), RoadColor
' left grass LINE (0, ScreenLine)-(X - HalfWidth, ScreenLine), GrassColor
' right grass LINE (X + HalfWidth, ScreenLine)-(320, ScreenLine), GrassColor
HalfWidth = HalfWidth - WidthStep ScreenLine = ScreenLine - 1
IF A > SegY THEN DX = DX + DDX END IF
X = X + DX
NEXT A
' background display
LINE (0, 0)-(320, horizon - 1), 9, BF
' others display
COLOR 15, 9
LOCATE 1, 1: PRINT "esc to exit" LOCATE 2, 1: PRINT "up-down : do the curve" LOCATE 3, 1: PRINT "left-right : change the direction" LOCATE 7, 10: PRINT "turn to the"
COLOR 4, 9 IF DDX = -.05 THEN LOCATE 7, 22: PRINT "right" IF DDX = .05 THEN LOCATE 7, 22: PRINT "left"
_LIMIT 50
_DISPLAY
IF _KEYDOWN(27) THEN END LOOP
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 14, 2012 7:43:32 GMT -5
This might be of interest to elusive as well. The curving road almost looks like the raster effect he was looking for information on..
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 14, 2012 8:44:58 GMT -5
i hope it's possible with BEX Certainly. Attached is a simple example that allows you to "bend" the road using the left / right keys. You might want to toggle the nametable from the default 512x512 pixels to 1024x256 if you want to have super-tight corners ( without wrapping artifacts ). This might be of interest to elusive as well. The curving road almost looks like the raster effect he was looking for information on.. I must have missed his post asking about that then Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 7, 2013 17:43:16 GMT -5
I don't know if the OP is still around but APA1.BEX and APA2.BEX in the examples folder are plotting demonstrations by DevSter himself.
|
|
|
Post by fl on Jan 14, 2013 9:09:13 GMT -5
hello. i don't understand the examples . could somenone explain to me how to put this image in middle of screen. example, the car of my game : the same in 16 colors:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 14, 2013 11:13:10 GMT -5
I don't know if the OP is still around but APA1.BEX and APA2.BEX in the examples folder are plotting demonstrations by DevSter himself. Those examples are great for someone who wants to draw lines. However, the OP asked the wrong question ( seems to be quite common among novices ) Instead of asking how to draw lines ( which he used on another system ), he should have asked how to do a pseudo-3D ( OutRun style ) racing game on the Megadrive. And you absolutely don't want to draw lines for that. could somenone explain to me how to put this image in middle of screen. Check out the Eggman.bex example i posted in this thread. You can use ImaGenesis to convert your image to the Megadrive format.
|
|
|
Post by fl on Jan 15, 2013 16:49:16 GMT -5
thanks for this example. good bitmap i begin to understand how it works. bye
|
|
|
Post by fl on Jan 25, 2013 9:03:05 GMT -5
hello it's me again with the help of moon, my project is beginning. i begin to understand how BEX works, but coding on Genesis is a little difficult.... here is my work in attachment i hope my project enjoy you, it's a BETA release, i try my engine on BEX. for this moment , i dont know how to do : - to move the road slowly and progressively - to put the grass behind the road - to put the two black "columns" on the side of the screen. if someone could help me, it would be nice ! if you don't know this little 1988 french game, go see how was the original here : www.cpc-power.com/index.php?page=detail&num=630(you can play it online) thanks in advance F.L Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 25, 2013 9:39:14 GMT -5
move the road slowly and progressively Color cycling. Make sure the vertical lines of your road use color index 0 to 15 consecutively. By "rotating" the color palette you can create the illusion of forward ( or backward ) motion. put the grass behind the road The MegaDrive has 2 background layers you can draw to ( SCROLL_A and SCROLL_B ). Simply draw the grass to SCROLL_B using the SETGFXPLANE command. put the two black "columns" on the side of the screen. Use sprites. Since the MegaDrive doesn't support hardware scaling, generally you use a couple of renditions ( small, normal, large, largest ) of the same object. Simply update the sprite position, size and used tile(s) depending on how close to the camera the object should appear. If you need any specific help with those techniques, let me know
|
|