|
Post by alexfish on May 8, 2013 11:11:55 GMT 1
Before you get too far down the road with BAC-PAC-BOY, Peter W. posted what looks like a better version of the game and in OpenGL rather than his Simple Window home brew (ASM) graphics animation library. Pac-Bug GameThank John Downloaded from site the exec fired up wine , no problem Added ;;; Just a note if using wine with the game ,,, play the game first , else go home will crash the System , other than that ,, I like this one ADDED .. Just had to revisit the the Pac-Bug , Re the site you posted Had a laugh , esp + BR Alex
|
|
|
Post by alexfish on May 8, 2013 11:39:24 GMT 1
Just for fun Bug Style BR Alex Attachments:
|
|
|
Post by alexfish on May 8, 2013 15:56:01 GMT 1
Hi Vovchik Think U where looking for these BR Alex Attachments:
|
|
|
Post by alexfish on May 8, 2013 18:31:56 GMT 1
Hi All
Here is a simple animation Routine using the animation bits in the post above
If have downloaded the Bac-Pac-Boy Demo
Place the animate folder in bacpacboy folder
also place a copy of hug.bac in same
Compile this demo in the bacpacboy folder
Remember these are not "HOME BREW" we are simply Experimenting With The Function's of Lib of GooCanvas
' *********************** ' INCLUDES ' ***********************INCLUDE hug.bac 'INCLUDE hug_imports.bac 'INIT ' *********************** ' END INCLUDES ' ***********************
' *********************** ' INITIALIZATION ' *********************** gdk$ = "libgdk-x11-2.0.so" IMPORT "gdk_pixbuf_new_from_file(char*,void**)" FROM gdk$ TYPE long ' HUG settings HUGOPTIONS("NOSCALING") CONST Goo$ = "libgoocanvas.so" ' setting for animation CONST GOO_CANVAS_ANIMATE_FREEZE = 0 CONST GOO_CANVAS_ANIMATE_RESET = 1 CONST GOO_CANVAS_ANIMATE_RESTART = 2 CONST GOO_CANVAS_ANIMATE_BOUNCE = 3
pos=0
' *********************** ' IMPORTS ' ***********************
' goocanvas imports IMPORT "goo_canvas_new" FROM Goo$ TYPE long IMPORT "goo_canvas_rect_new(long,double,double,double,double,...)" FROM Goo$ TYPE long IMPORT "goo_canvas_get_root_item(long)" FROM Goo$ TYPE long IMPORT "goo_canvas_set_bounds(long,double,double,double,double)" FROM Goo$ TYPE void IMPORT "goo_canvas_widget_new(long,long,double,double,double,double,...)" FROM Goo$ TYPE long IMPORT "goo_canvas_item_animate(long,double,double,double,double,int,int,int,int)" FROM Goo$ TYPE void IMPORT "goo_canvas_item_set_child_properties(long,long,...)" FROM Goo$ TYPE void IMPORT "goo_canvas_item_stop_animation(long)" FROM Goo$ TYPE void IMPORT "goo_canvas_item_set_simple_transform(long,double,double,double,double)" FROM Goo$ TYPE void IMPORT "goo_canvas_table_new(long,...)" FROM Goo$ TYPE long IMPORT "goo_canvas_image_new(long,long,double,double,...)" FROM Goo$ TYPE long IMPORT "goo_canvas_item_remove_child(long,long)" FROM Goo$ TYPE void IMPORT "goo_canvas_scroll_to(long,double,double)" FROM Goo$ TYPE void
' *********************** ' END IMPORTS ' ***********************
'@ DECLARES
'@ have left most bits of Declares As is But added explosion DECLARE pillwhere ASSOC NUMBER DECLARE eaten[256] DECLARE rect[256] DECLARE key$ ASSOC STRING DECLARE sets[350][350] DECLARE pills[350][350] DECLARE ghost[350][350] DECLARE i TYPE int DECLARE rowcol TYPE float DECLARE row TYPE double DECLARE col TYPE double
DECLARE explosion[6] TYPE NUMBER '@ END DECLARES
'@ KEY CODES
'65361 = left '65362 = up '65363 = right '65364 = down
key$(STR$(65361))="LEFT" key$(STR$(65362))="UP" key$(STR$(65363))="RIGHT" key$(STR$(65364))="DOWN"
' ------------------ FUNCTION GOOCANVAS(int hug_xsize, int hug_ysize) ' ------------------ ' set up GooCavas using HUG type format LOCAL canvas ,root canvas = goo_canvas_new() goo_canvas_set_bounds(canvas, 0, 0, hug_xsize, hug_ysize) IF HUG_WIDGET_SHOW THEN gtk_widget_show_all(canvas) END IF hug_widget_image(STR$(canvas)) = canvas hug_widget_xsize(STR$(canvas)) = hug_xsize hug_widget_ysize(STR$(canvas)) = hug_ysize hug_widget_signal(STR$(canvas)) = 4 hug_widget_s_widget(STR$(canvas)) = canvas hug_widget_type$(STR$(canvas)) = "canvas" RETURN canvas END FUNCTION
SUB load_animation LOCAL exp_1,exp_2,exp_3,exp_4,exp_5 exp_1 = gdk_pixbuf_new_from_file("./animate/exp1.tga", 0) exp_2 = gdk_pixbuf_new_from_file("./animate/exp2.tga", 0) exp_3 = gdk_pixbuf_new_from_file("./animate/exp3.tga", 0) exp_4 = gdk_pixbuf_new_from_file("./animate/exp4.tga", 0) exp_5 = gdk_pixbuf_new_from_file("./animate/exp5.tga", 0)
explosion[0]=goo_canvas_image_new(root_canvas1, exp_1, 0,0, 0) g_object_set(explosion[0],"visibility",1,NULL) explosion[1]=goo_canvas_image_new(root_canvas1, exp_2, 0,0, 0) g_object_set(explosion[1],"visibility",1,NULL) explosion[2]=goo_canvas_image_new(root_canvas1, exp_3, 0,0, 0) g_object_set(explosion[2],"visibility",1,NULL) explosion[3]=goo_canvas_image_new(root_canvas1, exp_4, 0,0, 0) g_object_set(explosion[3],"visibility",1,NULL) explosion[4]=goo_canvas_image_new(root_canvas1, exp_5, 0,0, 0) g_object_set(explosion[4],"visibility",1,NULL)
g_object_unref( exp_1) g_object_unref( exp_2) g_object_unref( exp_3) g_object_unref( exp_4) g_object_unref( exp_5) END SUB
SUB MK_GUI() ' ------------------ LOCAL mypix, obj , pill , gate , power,pac,gspook,gmspook,redspook,bluespook win = WINDOW("Exploding", 600, 450) canvas1 = GOOCANVAS(600, 450) ATTACH (win, canvas1, 0, 0) root_canvas1 = goo_canvas_get_root_item(canvas1) g_object_set(canvas1,"background-color","black",NULL) END SUB FUNCTION ANIMATE goo_canvas_item_animate(explosion[0],500,350, 2, 90, TRUE, 1000, 5, GOO_CANVAS_ANIMATE_RESTART) goo_canvas_item_animate(explosion[1],500,350, 2, 90, TRUE, 1000, 5, GOO_CANVAS_ANIMATE_RESTART) goo_canvas_item_animate(explosion[2],500,350, 2, 90, TRUE, 1000, 5, GOO_CANVAS_ANIMATE_RESTART) goo_canvas_item_animate(explosion[3],500,350, 2, 90, TRUE, 1000, 5, GOO_CANVAS_ANIMATE_RESTART) goo_canvas_item_animate(explosion[4],500,450, 2, 90, TRUE, 1000, 5, GOO_CANVAS_ANIMATE_RESTART) RETURN TRUE END FUNCTION EXPLOSION = 0 FUNCTION explode
SELECT EXPLOSION CASE 0 g_object_set(explosion[4],"visibility",1,NULL) g_object_set(explosion[0],"visibility",2,NULL) CASE 1 g_object_set(explosion[0],"visibility",1,NULL) g_object_set(explosion[1],"visibility",2,NULL) CASE 2 g_object_set(explosion[1],"visibility",1,NULL) g_object_set(explosion[2],"visibility",2,NULL)
CASE 3 g_object_set(explosion[2],"visibility",1,NULL) g_object_set(explosion[3],"visibility",2,NULL) CASE 4 g_object_set(explosion[3],"visibility",1,NULL) g_object_set(explosion[4],"visibility",2,NULL) END SELECT INCR EXPLOSION IF EXPLOSION = 5 THEN EXPLOSION = 0 RETURN TRUE END FUNCTION ' GLOBAL timedout timeout =500 MK_GUI load_animation ANIMATE TIMEOUT(timeout,explode) DISPLAY
Have Fun
Alex
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on May 8, 2013 20:08:45 GMT 1
Aurel has become daily entertainment. Glad to see you guys making head-way on the game front.
|
|
|
Post by vovchik on May 8, 2013 20:21:38 GMT 1
Dear Alex (et al.), Here are three sets of explosion pngs. They might just come in useful. With kind regards, vovchik PS. Thanks, Alex. Attachments:
|
|
|
Post by alexfish on May 8, 2013 21:03:50 GMT 1
Hi All
+
Thanks Vovchik
Can modify the Load Animation to
SUB load_animation LOCAL exp_1,exp_2,exp_3,exp_4,exp_5 exp_1 = gdk_pixbuf_new_from_file("./explosive-pngs/exp1.png", 0) exp_2 = gdk_pixbuf_new_from_file("./explosive-pngs/exp2.png", 0) exp_3 = gdk_pixbuf_new_from_file("./explosive-pngs/exp3.png", 0) exp_4 = gdk_pixbuf_new_from_file("./explosive-pngs/exp4.png", 0) exp_5 = gdk_pixbuf_new_from_file("./explosive-pngs/exp5.png", 0)
explosion[0]=goo_canvas_image_new(root_canvas1, exp_1, 0,0, 0) g_object_set(explosion[0],"visibility",1,NULL) explosion[1]=goo_canvas_image_new(root_canvas1, exp_2, 0,0, 0) g_object_set(explosion[1],"visibility",1,NULL) explosion[2]=goo_canvas_image_new(root_canvas1, exp_3, 0,0, 0) g_object_set(explosion[2],"visibility",1,NULL) explosion[3]=goo_canvas_image_new(root_canvas1, exp_4, 0,0, 0) g_object_set(explosion[3],"visibility",1,NULL) explosion[4]=goo_canvas_image_new(root_canvas1, exp_5, 0,0, 0) g_object_set(explosion[4],"visibility",1,NULL)
g_object_unref( exp_1) g_object_unref( exp_2) g_object_unref( exp_3) g_object_unref( exp_4) g_object_unref( exp_5) END SUB
To get Idea of what it is doing
Disable the ANIMATION
' GLOBAL timedout timeout =500 MK_GUI load_animation ' ANIMATE TIMEOUT(timeout,explode) DISPLAY
Also Experiment with the canvas colour
IE
SUB MK_GUI() ' ------------------ LOCAL mypix, obj , pill , gate , power,pac,gspook,gmspook,redspook,bluespook win = WINDOW("Exploding", 600, 450) canvas1 = GOOCANVAS(600, 450) ATTACH (win, canvas1, 0, 0) root_canvas1 = goo_canvas_get_root_item(canvas1) g_object_set(canvas1,"background-color","white",NULL) END SUB IF have bacongui or a color chooser , Bacongiu has one in 'OPTIONS' the can copy the string values IE
g_object_set(canvas1,"background-color","#F2F1F0",NULL)
Have Fun
Alex
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on May 8, 2013 21:04:07 GMT 1
scriba is < 500KB. Most of that 4.1MB is image/sound files needed for the game. I don't use the Bass sound lib and use the native Windows MM API to play the wave.
jrs@laptop:~/sb/wine/SM/pac-boy$ ls -l * -rw-rw-r-- 1 jrs jrs 466432 Apr 12 22:29 Oxygen.dll -rw-rw-r-- 1 jrs jrs 16391 Apr 14 20:33 PB.sb -rw-rw-r-- 1 jrs jrs 7007 Apr 14 17:32 sbsw.inc -rw-rw-r-- 1 jrs jrs 35840 Apr 9 14:11 sw.dll
gfx: total 3480 -rw-rw-r-- 1 jrs jrs 196662 Oct 14 2012 Atom.bmp -rw-rw-r-- 1 jrs jrs 393270 Oct 14 2012 Beam.bmp -rw-rw-r-- 1 jrs jrs 77878 Nov 14 14:53 Bild.bmp -rw-rw-r-- 1 jrs jrs 12342 Oct 11 2012 boyani.bmp -rw-rw-r-- 1 jrs jrs 196662 Oct 15 2012 BoyD.bmp -rw-rw-r-- 1 jrs jrs 196662 Oct 15 2012 BoyL.bmp -rw-rw-r-- 1 jrs jrs 196662 Oct 15 2012 BoyR.bmp -rw-rw-r-- 1 jrs jrs 196662 Oct 15 2012 BoyU.bmp -rw-rw-r-- 1 jrs jrs 196662 Oct 14 2012 bummani.bmp -rw-rw-r-- 1 jrs jrs 7978 May 10 2006 Caim.wav -rw-rw-r-- 1 jrs jrs 737334 Apr 12 13:41 Char.bmp -rw-rw-r-- 1 jrs jrs 41956 Sep 8 2005 Drown.wav -rw-rw-r-- 1 jrs jrs 196662 Oct 14 2012 exitani.bmp -rw-rw-r-- 1 jrs jrs 196662 Oct 19 2012 Fire.bmp -rw-rw-r-- 1 jrs jrs 29740 Oct 16 2003 Grab.wav -rw-rw-r-- 1 jrs jrs 18022 Jan 19 2008 Hit.wav -rw-rw-r-- 1 jrs jrs 196662 Oct 15 2012 pillani.bmp -rw-rw-r-- 1 jrs jrs 196662 Oct 15 2012 shrani.bmp -rw-rw-r-- 1 jrs jrs 196662 Oct 15 2012 starani.bmp -rw-rw-r-- 1 jrs jrs 8592 Aug 1 2003 success.wav
Maps: total 132 -rw-rw-r-- 1 jrs jrs 1200 Apr 12 13:30 map10-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 13:30 map10-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 13:30 map10-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 18:31 map11-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 18:31 map11-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 18:31 map11-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:40 map1-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:40 map1-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:40 map1-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 22:00 map2-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 22:00 map2-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 22:00 map2-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:46 map3-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:46 map3-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:46 map3-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:48 map4-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:48 map4-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:48 map4-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:49 map5-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:49 map5-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:49 map5-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:51 map6-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:51 map6-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 11 21:51 map6-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 12:26 map7-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 12:26 map7-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 12:26 map7-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 12:42 map8-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 12:42 map8-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 12:42 map8-3.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 18:23 map9-1.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 18:23 map9-2.txt -rw-rw-r-- 1 jrs jrs 1200 Apr 12 18:23 map9-3.txt
modules: total 44 -rw-rw-r-- 1 jrs jrs 41472 Apr 12 21:46 dllc.dll jrs@laptop:~/sb/wine/SM/pac-boy$
|
|
|
Post by alexfish on May 8, 2013 21:15:12 GMT 1
scriba is < 500KB. Most of that 5MB is image/sound files needed for the game. I don't use the Bass sound lib and use the native Windows MM API to play the wave. Hi John Have Scriba on Linux system and Quite impressed at its capabilities + have IUP and would dearly like to get Pac_Boy running Either in Wine or Linux at present do not have Scriba on Wine . baring in mind the SB in the dowload of Scriba SB_2.1_RC1_Linux.tbz , is 24.9 MB that , is after unpacking Any help would be appreciated. Have download Pac-Boy from one of Your previous post , BR Alex
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on May 8, 2013 21:42:02 GMT 1
1. Download the ScriptBasic 2.2 beta release for Windows. 2. In the Wine Console, set the search path to point to the bin directory. 3. To reduce duplicate files included in the game zips ... A. Copy the dllc.dll file to the SB modules directory B. Copy the oxygen.dll and sw.dll to the Wine system32 directory. 4. I would use the sbsw.inc from PAC-BOY as it has the most Simple Windows functions defined. 5. The rest of the .sb files can live in the same directory. That should give you a working Windows version of ScriptBasic under Wine. You should also install SB 64 bit for Linux when you're not playing games.
|
|
|
Post by alexfish on May 8, 2013 22:00:07 GMT 1
Thanks John
Will post back when Working
BR
Alex
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on May 8, 2013 22:03:54 GMT 1
FYI OxygenBasic runs/compiles great under Wine. (including the OpenGL stuff). O2 is a lightning fast Basic compiler. It's easy to create DLLs with it as well.
|
|
|
Post by alexfish on May 8, 2013 22:29:16 GMT 1
FYI OxygenBasic runs/compiles great under Wine. (including the OpenGL stuff). O2 is a lightning fast Basic compiler. It's easy to create DLLs with it as well. I installed Wine Under Protest , not for my benefit once Scriba and Pac-Boy is on "NO MORE" is going on it , hope those in Back Room heard that ;D Have Fun Alex
|
|
|
Post by Pjot on May 9, 2013 10:17:18 GMT 1
Folks, I have added the GooCanvas widget to HUG 0.86 also. Compared to the default GTK canvas, the GooCanvas can return an ID for each item drawn. When using HUG, the new HUG variable WIDGET always contains the widgetID of the last created widget, also for GooCanvas items. If you encounter problems, let me know. Regards Peter INCLUDE "hug.bac", INIT, WINDOW, CANVAS, DISPLAY, ATTACH, HUGOPTIONS, CIRCLE, PIXEL, LINE, SQUARE, OUT, PICTURE
INIT
HUGOPTIONS("NOSCALING") HUGOPTIONS("CANVAS GOO")
win = WINDOW("Goo Canvas", 500, 400)
canvas = CANVAS(500, 400)
ATTACH(win, canvas, 0, 0)
CIRCLE("#FF0000", 50, 50, 100, 100, 0)
LINE("#0000FF", 300, 10, 100, 350)
SQUARE("#FFFF00", 10, 300, 50, 50, TRUE)
OUT("<b>Hello</b> GOO Canvas", "#FF00FF", "#0000FF", 0, 0)
PICTURE("./eyes.svg", 400, 100, 64, 64)
FOR x = 0 TO 50 PIXEL("#FF00FF", 100+x, 40) NEXT
DISPLAY
|
|
|
Post by alexfish on May 9, 2013 12:06:04 GMT 1
Hey Peter Looks Like another Big Thank You To All If there are some BaCon eyes in Vovchik's Svg's see early post near Bac-Pac-Boy Demo Thanks again BR Alex Attachments:
|
|