https://wiki.bennugd.org/api.php?action=feedcontributions&user=Josebagar&feedformat=atomBennu Wiki - User contributions [en]2024-03-29T06:54:22ZUser contributionsMediaWiki 1.36.2https://wiki.bennugd.org/index.php?title=Cdinfo&diff=8732Cdinfo2011-09-03T14:23:34Z<p>Josebagar: Added a category to the page, still needs info.</p>
<hr />
<div>[[category:variables]]<br />
[[category:predefined]]<br />
[[category:global variables]]<br />
[[category:CD]]<br />
[[Category:mod_cd]]<br />
<br />
[[Global variables|'''Up to Global Variables''']]<br />
<br />
----<br />
<br />
<br />
== Definition ==<br />
'''Struct''' cdinfo<br />
<br />
cdinfo is a [[global|global variable]] [[struct]], containing information about a CD/DVD drive, last obtained using [[cd_getinfo]]().<br />
<br />
== Members ==<br />
''filling this out later...''<br />
{|<br />
| ''Member name'' || - ''Description''<br />
|-<br />
| '''INT''' current_track || - <br />
|-<br />
| '''INT''' current_frame || - <br />
|-<br />
| '''INT''' tracks || - <br />
|-<br />
| '''INT''' minute || - <br />
|-<br />
| '''INT''' second || - <br />
|-<br />
| '''INT''' subframe || - <br />
|-<br />
| '''INT''' minutes || - <br />
|-<br />
| '''INT''' seconds || - <br />
|-<br />
| '''INT''' subframes || - <br />
|-<br />
| '''STRUCT''' track[99]<br />
:{|<br />
| '''INT''' audio || - <br />
|-<br />
| '''INT''' minutes || - <br />
|-<br />
| '''INT''' seconds || - <br />
|-<br />
| '''INT''' subframes || - <br />
|}<br />
|}<br />
<br />
{{Globals}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Wpad_is_ready&diff=8730Wpad is ready2011-09-03T14:04:47Z<p>Josebagar: Undo revision 8729 by Josebagar (Talk)</p>
<hr />
<div>[[Category:functions]]<br />
[[Category:Joystick]]<br />
[[Category:mod_wpad]]<br />
<br />
==Definition==<br />
'''INT''' wpad_is_ready ( <'''INT''' wpad_number> )<br />
<br />
Returns whether controller ''wpad_number'' is ready to be used. <br />
<br />
== Parameters ==<br />
{| <br />
| '''INT''' wpad_number || - The controller whose state you want to retrieve. ''wpad_number'' must be a positive integer up to 8 (the maximum number of controllers supported by the Wii console).<br />
|}<br />
<br />
== Returns ==<br />
'''INT''' : Controller state; 1 means controller is ready and 0 means it's not.<br />
<br />
== Example ==<br />
<pre><br />
Global<br />
int i;<br />
End<br />
<br />
Process Main()<br />
Begin<br />
while(! mouse.left)<br />
delete_text(ALL_TEXT)<br />
for(i=1; i<=8; i++)<br />
if(wpad_is_ready(i))<br />
write(0,0,10*i,0,"Controller "+i+" is ready");<br />
else<br />
write(0,0,10*i,0,"Controller "+i+" is not ready")<br />
end;<br />
end;<br />
frame;<br />
end;<br />
End<br />
</pre><br />
Used in example: [[write]](), [[wpad_is_ready]](), [[mouse]], [[delete_text]]()<br />
<br />
{{Funcbox<br />
| category = mod_wpad<br />
}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Bennu_SVN&diff=8706Bennu SVN2011-09-02T09:56:51Z<p>Josebagar: /* Source repository & latest builds */</p>
<hr />
<div>This page contains info on the development ('''S'''ub'''V'''ersio'''N''' or '''SVN''') versions of [[Bennu]].<br />
<br />
== Source repository & latest builds ==<br />
* [http://bennugd.svn.sourceforge.net/viewvc/bennugd/ SVN repository] (checkout from <code>https://bennugd.svn.sourceforge.net/svnroot/bennugd</code>).<br />
* Official builds are currently Release Candidates (you probably want these), you can download them [http://www.bennugd.org/node/2 here].<br />
<br />
== Changelog ==<br />
The Bennu developers usually keep track of their changes in the forums, in a developers diary topic. There are two topics, one in English and one in Spanish. As the main core developer [[SplinterGU]] and a big part of the community is Spanish this is the more extensively used topic:<br />
<br />
* [http://forum.bennugd.org/index.php?topic=270.0 English Worklog]<br />
* [http://forum.bennugd.org/index.php?topic=102.0 Spanish Worklog]</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Wpad_info&diff=8045Wpad info2011-04-11T00:39:32Z<p>Josebagar: </p>
<hr />
<div>[[Category:functions]]<br />
[[Category:Joystick]]<br />
[[Category:mod_wpad]]<br />
<br />
==Definition==<br />
'''INT''' wpad_info ( <'''INT''' wpad_number> , <'''INT''' infotype> )<br />
<br />
Returns info from controller ''wpad_number''.<br />
<br />
== Parameters ==<br />
{| <br />
| '''INT''' wpad_number || - The controller whose state you want to retrieve. ''wpad_number'' must be a positive integer up to 8 (the maximum number of controllers supported by the Wii console).<br />
|-<br />
| '''INT''' infotype || - What [[wpad infotypes|type of information]] you want.<br />
|}<br />
<br />
== Returns ==<br />
'''INT''' : Returns the information you want.<br /><br />
If the specified infotype was not recognized it returns 0.<br />
<br />
== Example ==<br />
<pre><br />
Process Main()<br />
Begin<br />
set_mode(320, 240, 8);<br />
<br />
// Wait until the first controller is fully ready<br />
while(! wpad_is_ready(1))<br />
frame;<br />
end;<br />
<br />
// Display whether the Nunchuk is connected to this controller or not<br />
if(wpad_info(1, WPAD_HAS_NUNCHUK))<br />
write(0, 160, 120, 4, "Nunchuk is attached to Wiimote 1");<br />
else<br />
write(0, 160, 120, 4, "Nunchuk not attached to Wiimote 1");<br />
end<br />
<br />
// Pressing button "A" on your Wiimote will trigger a mouse.left event<br />
while(! mouse.left)<br />
frame;<br />
end;<br />
End<br />
</pre><br />
Used in example: [[write]](), [[wpad_is_ready]](), [[mouse]], [[wpad_info]]()<br />
<br />
{{Funcbox<br />
| category = Mod_wpad<br />
}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Wpad_info_bb&diff=8042Wpad info bb2011-04-11T00:29:43Z<p>Josebagar: Added reference to missing delete_text function</p>
<hr />
<div>[[Category:functions]]<br />
[[Category:Joystick]]<br />
[[Category:mod_wpad]]<br />
<br />
==Definition==<br />
'''INT''' wpad_info_bb ( <'''INT''' wpad_number> , <'''INT''' infotype> )<br />
<br />
Returns info from Balance Board number ''wpad_number''. This function will only query info from Wii Balance Board devices. To know if a particular "wpad_number" corresponds to a Wii Balance Board device, use [[wpad_info]]().<br />
Please note that each Wii Balance Board device uses two communication channels at once.<br />
<br />
== Parameters ==<br />
{| <br />
| '''INT''' wpad_number || - The Wii Balance Board whose state you want to retrieve. ''wpad_number'' must be a positive integer up to 8 (the maximum number of controllers supported by the Wii console).<br />
|-<br />
| '''INT''' infotype || - What [[wpad infotypes|type of information]] you want.<br />
|}<br />
<br />
== Returns ==<br />
'''INT''' : Returns the information you want.<br /><br />
If the specified infotype was not recognized it returns 0.<br />
<br />
== Example ==<br />
<pre><br />
import "mod_wpad"<br />
import "mod_video"<br />
import "mod_text"<br />
import "mod_mouse"<br />
<br />
GLOBAL<br />
scr_width = 640, scr_height=480;<br />
End;<br />
<br />
Process main()<br />
Private<br />
int i=0, bb=-1, weight=0;<br />
<br />
Begin<br />
// Check that we can set the video mode before actually setting it<br />
if(!mode_is_ok(scr_width, scr_height, 16, MODE_WINDOW))<br />
return -1;<br />
end;<br />
set_mode(scr_width, scr_height, 16, MODE_WINDOW);<br />
<br />
while(! mouse.left)<br />
for(i=0; i<=7; i++)<br />
if(wpad_is_ready(i) > 0)<br />
write(0, scr_width/2, 50+10*i, 4, "Joy "+i+" is ready (Battery: "+wpad_info(i, WPAD_BATT)+")");<br />
end;<br />
if(wpad_info(i, WPAD_IS_BB) > 0)<br />
write(0, scr_width/2, scr_height/2+10*i, 4, "Using "+i+" as a Balance Board");<br />
bb = i;<br />
end;<br />
end;<br />
if(bb >= 0)<br />
// Get your weight (in kg) from the Wii Balance Board as the sum of all the partial measurements<br />
// from each support in your device.<br />
weight = wpad_info_bb(bb, WPAD_WTL);<br />
weight += wpad_info_bb(bb, WPAD_WTR);<br />
weight += wpad_info_bb(bb, WPAD_WBL);<br />
weight += wpad_info_bb(bb, WPAD_WBR);<br />
write(0, scr_width/2, 3*scr_height/4, 4, "Meassured weight: "+weight );<br />
// Get the position of your center of gravity<br />
write(0, scr_width/2, 3*scr_height/4+10, 4, "X:"+<br />
wpad_info_bb(bb, WPAD_X) + " Y: "+<br />
wpad_info_bb(bb, WPAD_Y) );<br />
end;<br />
FRAME;<br />
delete_text(ALL_TEXT);<br />
bb = -1;<br />
End;<br />
End;<br />
</pre><br />
Used in example: [[write]](), [[delete_text]](), [[mode_is_ok]](), [[set_mode]](), [[wpad_is_ready]](), [[mouse]], [[wpad_info]]()<br />
<br />
{{Funcbox<br />
| category = mod_wpad<br />
}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Get_modes&diff=8040Get modes2011-04-11T00:14:01Z<p>Josebagar: Added source code sample.</p>
<hr />
<div>[[Category:functions]]<br />
[[Category:programinteraction]]<br />
[[Category:mod_video]]<br />
<br />
== Syntax ==<br />
'''POINTER''' get_modes ( <'''INT''' depth>, <'''INT''' flags> )<br />
<br />
== Description ==<br />
Returns a pointer to an array of available screen dimensions for the given [[depth]] and [[render flags]], sorted largest to smallest.<br />
<br />
Returns NULL if there are no dimensions available for a particular format, or -1 if any dimension is okay for the given format.<br />
<br />
== Parameters ==<br />
{| <br />
| '''INT''' depth || - [[Color depth]] of the screen. See [[color_depths]].<br />
|- <br />
| '''INT''' flags || - Mode of rendering. See [[render flags]].<br />
|}<br />
<br />
== Returns ==<br />
'''POINTER''' : A pointer to an array of available screen dimensions<br />
<br />
== Example ==<br />
<pre>import "mod_say";<br />
import "mod_video";<br />
<br />
Process Main()<br />
Private<br />
int * modes;<br />
Begin<br />
// Modes will point to an array whose values are acceptable values for resolution<br />
<br />
// Get 8bpp acceptable modes when in fullscreen<br />
modes = get_modes(8, MODE_FULLSCREEN);<br />
say ("8bit modes");<br />
say ("----------");<br />
if (!modes)<br />
say ("no video modes available!");<br />
elsif (modes == -1 )<br />
say ("any video mode available!");<br />
else<br />
while (*modes)<br />
say ("> " + *modes++ + " x " + *modes++ );<br />
end<br />
end<br />
say ("");<br />
<br />
// Get 16bpp acceptable modes when in fullscreen<br />
modes = get_modes(16, MODE_FULLSCREEN);<br />
say ("16bit modes");<br />
say ("-----------");<br />
if (!modes)<br />
say ("no video modes available!");<br />
elsif (modes == -1 )<br />
say ("any video mode available!");<br />
else<br />
while (*modes)<br />
say ("> " + *modes++ + " x " + *modes++ );<br />
end<br />
end<br />
say ("");<br />
<br />
// Get 24bpp acceptable modes when in fullscreen<br />
modes = get_modes(24, MODE_FULLSCREEN);<br />
say ("24bit modes");<br />
say ("-----------");<br />
if (!modes)<br />
say ("no video modes available!");<br />
elsif (modes == -1 )<br />
say ("any video mode available!");<br />
else<br />
while (*modes)<br />
say ("> " + *modes++ + " x " + *modes++ );<br />
end<br />
end<br />
say ("");<br />
<br />
// Get 32bpp acceptable modes when in fullscreen<br />
modes = get_modes(32, MODE_FULLSCREEN);<br />
say ("32bit modes");<br />
say ("-----------");<br />
if (!modes)<br />
say ("no video modes available!");<br />
elsif (modes == -1 )<br />
say ("any video mode available!");<br />
else<br />
while (*modes)<br />
say ("> " + *modes++ + " x " + *modes++ );<br />
end<br />
end<br />
say ("");<br />
<br />
End<br />
</pre><br />
Used in example: [[say]](), [[Render_flags|MODE_FULLSCREEN]]<br />
<br />
{{Moduledocbox<br />
| module = Mod_video<br />
}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Wpad_infotypes&diff=7905Wpad infotypes2010-10-26T14:23:20Z<p>Josebagar: </p>
<hr />
<div>[[Category:constantcategories]]<br />
[[Category:mod_wpad]]<br />
<br />
== Definition ==<br />
Wpad infotypes are used in [[wpad_info]](), [[wpad_info_bb]](), to specify what information about a Wii controller is wanted.<br />
<br />
== WPAD_INFO constants ==<br />
Constants to be used with [[wpad_info]]().<br />
{|<br />
| ''Constant'' || - ''Value'' || - ''Description''<br />
|-<br />
| WPAD_BATT || - 0 || - Battery left on device. [[wpad_info]]() will return 0<batt<255.<br />
|-<br />
| WPAD_X || - 1 || - X position of the pointer in the screen.<br />
|-<br />
| WPAD_Y || - 2 || - Y position of the pointer in the screen.<br />
|-<br />
| WPAD_Z || - 3 || - Distance of the Wiimote from the screen (in meters).<br />
|-<br />
| WPAD_ANGLE || - 4 || - The angle of your Wiimote.<br />
|-<br />
| WPAD_PITCH || - 5 || - Pitch angle of your Wiimote.<br />
|-<br />
| WPAD_ROLL || - 6 || - Roll angle of your Wiimote.<br />
|-<br />
| WPAD_ACCELX || - 7 || - Acceleration measured in the X axis of your Wiimote.<br />
|-<br />
| WPAD_ACCELY || - 8 || - Acceleration measured in the Y axis of your Wiimote.<br />
|-<br />
| WPAD_ACCELZ || - 9 || - Acceleration measured in the Z axis of your Wiimote.<br />
|-<br />
| WPAD_GX || - 10 || - Angle to the local vertical measured in the X-plane.<br />
|-<br />
| WPAD_GY || - 11 || - Angle to the local vertical measured in the Y-plane.<br />
|-<br />
| WPAD_GZ || - 12 || - Angle to the local vertical measured in the Z-plane.<br />
|-<br />
| WPAD_IS_BB || - 100 || - Whether controller is a Balance Board or not.<br />
|-<br />
| WPAD_HAS_NUNCHUK || - 101 || - Whether controller has a Nunchuk attached or not.<br />
|-<br />
| WPAD_HAS_CLASSIC || - 102 || - Whether controller has a classic controller attached or not..<br />
|-<br />
| WPAD_HAS_GUITAR || - 103 || - Whether controller has a Guitar Hero controller attached or not.<br />
|}<br />
<br />
== WPAD_INFO_BB constants ==<br />
Constants to be used with [[wpad_info_bb]]().<br />
<br />
{|<br />
| ''Constant'' || - ''Value'' || - ''Description''<br />
|-<br />
| WPAD_BATT || - 0 || - Battery left on device. [[wpad_info]]() will return 0<batt<255.<br />
|-<br />
| WPAD_X || - 1 || - X position of the center of gravity in the Wii Balance Board.<br />
|-<br />
| WPAD_Y || - 2 || - Y position of the center of gravity in the Wii Balance Board.<br />
|-<br />
| WPAD_WTL || - 3 || - Weight as measured by the Wii Balance Board's top left sensor.<br />
|-<br />
| WPAD_WTR || - 4 || - Weight as measured by the Wii Balance Board's top right sensor.<br />
|-<br />
| WPAD_WBL || - 5 || - Weight as measured by the Wii Balance Board's bottom left sensor.<br />
|-<br />
| WPAD_WBR || - 6 || - Weight as measured by the Wii Balance Board's bottom right sensor.<br />
|}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Mod_wpad&diff=7903Mod wpad2010-10-26T14:15:30Z<p>Josebagar: Module really depends on mod_joy, not libjoy</p>
<hr />
<div>[[Category:modules]]<br />
[[Category:3rd party]]<br />
[[Category:mod_joy]]<br />
[[Category:mod_wpad]]<br />
<br />
[[Modules|'''Up to Modules''']]<br />
<br />
----<br />
<br />
Wii controller support module.<br />
This library will help you read input data and operate Wii controllers.<br />
<br />
== Usage ==<br />
<br />
{{module_exports<br />
| modulename = mod_wpad<br />
}}<br />
<br />
{{modulebox}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=OS_WII&diff=7862OS WII2010-03-31T15:31:31Z<p>Josebagar: Page creation</p>
<hr />
<div>#REDIRECT [[OS_codes]]<br />
<br />
[[Category:constants]]<br />
[[Category:internal]]</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Draw_curve&diff=7860Draw curve2010-03-31T15:22:49Z<p>Josebagar: Added an example of draw_curve usage that displays three curves</p>
<hr />
<div>[[Category:functions]]<br />
[[Category:drawing]]<br />
[[Category:mod_draw]]<br />
<br />
==Definition==<br />
'''INT''' draw_curve ( <'''INT''' x0> , <'''INT''' y0> , <'''INT''' x1> , <'''INT''' y1> , <'''INT''' x2> , <'''INT''' y2> , <'''INT''' x3> , <'''INT''' y3> , <'''INT''' smoothness> )<br />
<br />
Draws a curve starting at the point ''(x0,y0)'', ending at the point ''(x3,y3)'' and influenced by the points ''(x1,y1)'' and ''(x2,y2)'' with a certain level of smoothness.<br />
<br />
== Parameters ==<br />
{|<br />
| '''INT''' x0 || - The x coordinate of the starting point of the curve.<br />
|- <br />
| '''INT''' y0 || - The y coordinate of the starting point of the curve.<br />
|- <br />
| '''INT''' x1 || - The x coordinate of the first influence point of the curve.<br />
|- <br />
| '''INT''' y1 || - The x coordinate of the first influence point of the curve.<br />
|- <br />
| '''INT''' x2 || - The x coordinate of the second influence point of the curve.<br />
|- <br />
| '''INT''' y2 || - The x coordinate of the second influence point of the curve.<br />
|- <br />
| '''INT''' x3 || - The x coordinate of the end point of the curve.<br />
|- <br />
| '''INT''' y3 || - The y coordinate of the end point of the curve.<br />
|- <br />
| '''INT''' smoothness || - The smoothness with which the line will be drawn from 1 to 15, 15 being the smoothest.<br />
|- <br />
|}<br />
<br />
== Returns ==<br />
'''INT''' : [[DrawID]]<br />
{|<br />
| -1 || - Error.<br />
|-<br />
| 1 || - If drawn after [[drawing_map]]().<br />
|-<br />
| !-1&&!1 || - The [[DrawID]] of the [[drawing]] created.<br />
|}<br />
<br />
== Example ==<br />
<br />
<pre><br />
import "mod_draw"<br />
import "mod_video"<br />
import "mod_mouse"<br />
import "mod_map"<br />
<br />
GLOBAL<br />
scr_width = 640, scr_height=480;<br />
End;<br />
<br />
Process main()<br />
Begin<br />
/* Check that we can set the video mode before actually setting it */<br />
if(!mode_is_ok(scr_width, scr_height, 16, MODE_WINDOW))<br />
return -1;<br />
end;<br />
set_mode(scr_width, scr_height, 16, MODE_WINDOW);<br />
<br />
/* Draw three long bezier lines with different colors and smoothnesses */<br />
drawing_map(0, 0);<br />
drawing_color(rgb(255, 0, 0));<br />
draw_curve(0, scr_height/4, scr_width/4, 0, 3*scr_width/4, 2*scr_height/4,<br />
scr_width, scr_height/4, 1);<br />
drawing_color(rgb(0, 255, 0));<br />
draw_curve(0, 2*scr_height/4, scr_width/4, scr_height/4, 3*scr_width/4,<br />
3*scr_height/4, scr_width, 2*scr_height/4, 3);<br />
drawing_color(rgb(0, 0, 255));<br />
draw_curve(0, 3*scr_height/4, scr_width/4, 2*scr_height/4, 3*scr_width/4,<br />
4*scr_height/4, scr_width, 3*scr_height/4, 15);<br />
<br />
while(! mouse.left)<br />
FRAME;<br />
end;<br />
<br />
// Delete all the lines<br />
delete_draw(0);<br />
End;<br />
</pre><br />
Used in example: [[mode_is_ok]](), [[set_mode]](), [[drawing_map]]() [[drawing_color]](), [[rgb]](), [[draw_curve]](), [[delete_draw]]()<br />
<br />
{{Funcbox<br />
| category=Drawing<br />
}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Ubuntu_software_sources_reload_sources.png&diff=7843File:Ubuntu software sources reload sources.png2010-01-18T21:57:59Z<p>Josebagar: Image showing the dialog that asks for permission to reload the repository data once the list of repos has been modifies by software-properties-gtk in Ubuntu Karmic.</p>
<hr />
<div>Image showing the dialog that asks for permission to reload the repository data once the list of repos has been modifies by software-properties-gtk in Ubuntu Karmic.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Ubuntu_software_sources_aptline.png&diff=7842File:Ubuntu software sources aptline.png2010-01-18T21:54:48Z<p>Josebagar: Image showing the software-properties-gtk program that's included with Ubuntu and the options required for adding the unofficial bennugd PPA to your system.</p>
<hr />
<div>Image showing the software-properties-gtk program that's included with Ubuntu and the options required for adding the unofficial bennugd PPA to your system.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Sort&diff=7834Sort2009-12-31T00:57:19Z<p>Josebagar: /* Example */ Added imports and changed variable x to i for the loops.</p>
<hr />
<div>[[Category:functions]]<br />
[[Category:sorting]]<br />
[[Category:mod_sort]]<br />
<br />
== Syntax ==<br />
'''INT''' sort ( <'''VARSPACE''' array> , [<'''INT''' datacount>] )<br />
<br />
== Description ==<br />
Sorts an [[array]] by sorting a certain number of elements, by using the first variable in each element. By default the whole array is sorted.<br />
<br />
If the elements contain multiple variables, [[ksort]]() can be used to select the variable to be used for sorting. For more advanced sorting, look at [[quicksort]]().<br />
<br />
== Parameters ==<br />
{| <br />
| '''VARSPACE''' array || - The [[array]] to be sorted.<br />
|-<br />
| ['''INT''' datacount] || - Number of elements to sort.<br />
|}<br />
<br />
== Returns ==<br />
'''INT''': Successrate<br />
{|<br />
| [[true]] || - Sorting succeeded.<br />
|-<br />
| [[false]] || - Sorting failed. Look in the output for the error.<br />
|}<br />
<br />
== Example ==<br />
<pre><br />
import "mod_sort";<br />
import "mod_key";<br />
import "mod_say";<br />
<br />
Type _player<br />
String name;<br />
int score;<br />
End<br />
<br />
Const<br />
maxplayers = 5;<br />
End;<br />
<br />
<br />
Process main()<br />
Private<br />
_player player[maxplayers-1];<br />
int i=0;<br />
Begin<br />
// Insert some values<br />
player[0].name = "That one bad looking dude";<br />
player[1].name = "Ah pretty lame guy";<br />
player[2].name = "Some cool dude";<br />
player[3].name = "OMG ZOMG guy";<br />
player[4].name = "This person is ok";<br />
<br />
player[0].score = 70;<br />
player[1].score = 30;<br />
player[2].score = 80;<br />
player[3].score = 90;<br />
player[4].score = 50;<br />
<br />
<br />
// Show array<br />
say("-------------------- unsorted");<br />
for(i=0; i<maxplayers; i++)<br />
say(player[i].name + " - " + player[i].score);<br />
end<br />
<br />
/* Sort by name ( quicksort() can't be used to sort Strings,<br />
as a String in Bennu is a pointer to the actual String,<br />
so it would sort the pointer addresses */<br />
<br />
// sort()<br />
sort(player); // sorts by name because name is the first variable in each element<br />
<br />
// Show array<br />
say("-------------------- name - sort()");<br />
for(i=0; i<maxplayers; i++)<br />
say(player[i].name + " - " + player[i].score);<br />
end<br />
<br />
// ksort()<br />
ksort(player,player[0].name,maxplayers);<br />
<br />
// Show array<br />
say("-------------------- name - ksort()");<br />
for(i=0; i<maxplayers; i++)<br />
say(player[i].name + " - " + player[i].score);<br />
end<br />
<br />
/* Sort by score (sort() cannot be used here, because score is not the first variable) */<br />
<br />
// ksort()<br />
ksort(player,player[0].score,maxplayers);<br />
<br />
// Show array<br />
say("-------------------- score - ksort()");<br />
for(i=0; i<maxplayers; i++)<br />
say(player[i].name + " - " + player[i].score);<br />
end<br />
<br />
// quicksort()<br />
quicksort(&player[0],sizeof(_player),maxplayers,sizeof(String),sizeof(int),0);<br />
<br />
// Show array<br />
say("-------------------- score - quicksort()");<br />
for(i=0; i<maxplayers; i++)<br />
say(player[i].name + " - " + player[i].score);<br />
end<br />
End<br />
</pre><br />
Used in example: [[say]](), [[sort]](), [[ksort]](), [[quicksort]](), [[type]], [[array]], [[pointer]]</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Special:Badtitle/NS100:Fostiator&diff=7833Special:Badtitle/NS100:Fostiator2009-12-30T01:05:33Z<p>Josebagar: Added categories</p>
<hr />
<div>[[category:Projects]]<br />
[[category:Games]]<br />
[[category:Examples]]<br />
[[Category:ProjectFostiator]]<br />
<br />
{{Project<br />
| project_title = Fostiator<br />
| project_name = Daniel Navarro's Fostiator<br />
| project_type = Fighting game<br />
}}<br />
<br />
Fostiator is a fighting game by Daniel Navarro that was bundled with the original DIV Games Studio suite.<br />
This project has just updated the code so that it works in a modern version of Bennu, with as little changes to the source as possible.<br />
This code is believed to be free to use for learning purposes.<br />
<br />
The game was created as a sample for DIV beginners, so it should be easy to understand. Howevere, beware that:<br />
* Vast majority of comments are still in Spanish.<br />
* Some bugs are present, due to differences between BennuGD and DIV.<br />
<br />
== Game code ==<br />
<pre><br />
import "mod_say";<br />
import "mod_key";<br />
import "mod_video";<br />
import "mod_text";<br />
import "mod_proc";<br />
import "mod_string";<br />
import "mod_map";<br />
import "mod_timers";<br />
import "mod_draw";<br />
import "mod_rand";<br />
import "mod_screen";<br />
import "mod_time";<br />
import "mod_math";<br />
import "mod_sound";<br />
import "mod_scroll";<br />
import "mod_grproc";<br />
#define sound(a,b,c) play_wav(a,0)<br />
#define fade_off(); fade(0,0,0,16); while(fading) FRAME; End;<br />
#define fade_on(); fade(100,100,100,16); while(fading) FRAME; End;<br />
<br />
//------------------------------------------------------------------------------<br />
// TITULO: FOSTIATOR<br />
// AUTOR: DANIEL NAVARRO<br />
// FECHA: 15/06/97<br />
//------------------------------------------------------------------------------<br />
<br />
CONST<br />
// Distintos estados de los munecos<br />
_parado=0;<br />
_avanzando=1;<br />
_retrocediendo=2;<br />
_agachandose=3;<br />
_agachado=4;<br />
_levantandose=5;<br />
_saltando=6;<br />
_golpe_bajo=7;<br />
_punetazo=8;<br />
_patada_giratoria=9;<br />
_patada_normal=10;<br />
_patada_aerea=11;<br />
_tocado=12;<br />
_muerto=13;<br />
<br />
// Distintas posiciones de los munecos<br />
saltar=0;<br />
agacharse=1;<br />
avanzar=2;<br />
retroceder=3;<br />
golpear=4;<br />
<br />
// Tipo de control del muneco<br />
control_teclado1=1;<br />
control_teclado2=2;<br />
control_ordenador=0;<br />
<br />
default_fps=24; // Numero de imagenes por segundo<br />
<br />
GLOBAL<br />
// Secuencia de animacin de cada uno de los estados de los munecos<br />
anim0[]=1,1,1,14,14,15,15,16,16,17,17,17,16,16,15,15,14,14;<br />
anim1[]=1,2,3,4,5,6,7,8;<br />
anim2[]=1,8,7,6,5,4,3,2;<br />
anim3[]=8,9,10,11,12,13;<br />
anim4[]=13;<br />
anim5[]=13,12,11,10,9,8;<br />
anim6[]=18,19,20,21,21,22,22,22,22,23,23,23,23,24,24,24,24,24,24,24,24;<br />
anim7[]=52,54,54,54,54,53,53,52,51;<br />
anim8[]=25,26,27,28,28,28,28,27,27,26,25;<br />
anim9[]=29,30,31,32,33,33,34,35,36,37,38,39;<br />
anim10[]=29,30,31,32,32,32,31,31,30,30,29;<br />
anim11[]=18,19,20,21,21,22,22,24,40,41,41,41,41,41,41,41,41,41,41,41,41,41;<br />
anim12[]=1,42,42,43,43,42,42;<br />
anim13[]=1,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50;<br />
<br />
s_golpe1; // Identificadores de sonidos<br />
s_golpe2;<br />
s_golpe3;<br />
s_tocado1;<br />
s_tocado2;<br />
s_tocado3;<br />
s_aire1;<br />
s_aire2;<br />
s_aire3;<br />
s_aire4;<br />
s_aire5;<br />
s_muerto;<br />
<br />
id_luchador1,id_luchador2; // Identificador de ambos combatientes<br />
id_auxiliar; // Identificador auxiliar<br />
<br />
combates1; // Numero de combates que ha ganado el primero<br />
combates2; // Numero de combates que ha ganado el segundo<br />
<br />
estado_juego; // 0-parado, 1-jugando, 2-fin combate<br />
<br />
escenario; // Escenario de lucha 0 / 1<br />
<br />
luchador1=1; // 0-Ripley, 1-Bishop, 2-Alien, 3-Nostromo<br />
luchador2=2; // 0-Ripley, 1-Bishop, 2-Alien, 3-Nostromo<br />
<br />
nivel=1; // Dificultad del juego (0..2)<br />
modo; // Modo de juego (ver modos[])<br />
sangre=1; // Nivel de sangre (ver sangres[])<br />
<br />
// Textos de las opciones de combate<br />
nombres[]="RIPLEY","BISHOP","ALIEN","NOSTROMO";<br />
escenarios[]="ESCENARIO 1 : CASTILLO IKA","ESCENARIO 2 : LA CUEVA","ESCENARIO 3: DESIERTO";<br />
niveles[]="DIFICULTAD : FACIL","DIFICULTAD : NORMAL","DIFICULTAD : DIFICIL";<br />
modos[]="ORDENADOR contra ORDENADOR"," TECLAS CURSOR contra ORDENADOR",<br />
"TECLAS QA-RT-X contra ORDENADOR","TECLAS QA-RT-X contra TECLAS CURSOR";<br />
sangres[]="NIVEL DE SANGRE : NINGUNA","NIVEL DE SANGRE : NORMAL","NIVEL DE SANGRE : EXTASIS";<br />
<br />
struct texto[6] // Textos donde se guardan las opciones del combate<br />
x,y;<br />
codigo;<br />
END = 320,480,0,<br />
320,90,0,<br />
320,120,0,<br />
320,150,0,<br />
100,364,0,<br />
320,364,0,<br />
540,364,0;<br />
<br />
opcion; // opcion seleccionada del menu<br />
opcion_anterior;<br />
<br />
esc_pulsado; // Indica si se ha abortado con ESC<br />
<br />
grises[255]= // Tabla de conversion de los colores a grises<br />
0,236,203,220,159,156,155,153,151,150,134,89,90,92,94,94,<br />
45,46,69,59,103,93,90,134,150,151,155,156,159,220,203,236,<br />
41,43,46,47,69,59,101,94,40,41,43,43,44,45,46,47,<br />
40,41,44,45,45,46,47,68,69,58,58,59,58,58,106,101,<br />
43,45,47,47,47,68,68,68,68,58,59,101,101,101,59,59,<br />
45,59,101,94,90,90,90,90,90,89,90,90,90,93,94,94,<br />
69,59,58,106,103,101,101,103,101,101,59,59,94,92,94,93,<br />
101,94,93,93,94,92,93,89,89,134,134,134,151,150,150,153,<br />
101,90,89,90,134,134,134,134,134,90,89,134,134,150,150,151,<br />
103,134,134,134,150,150,150,151,153,153,153,155,156,156,159,159,<br />
90,89,150,151,153,155,156,219,219,220,223,203,203,203,236,235,<br />
134,150,150,151,153,153,153,151,155,156,156,159,220,223,236,237,<br />
134,153,155,156,156,159,219,220,220,201,203,203,201,203,203,236,<br />
151,155,156,156,219,219,220,159,155,155,159,219,220,219,220,223,<br />
151,159,153,155,220,220,159,155,223,236,235,235,236,237,238,237,<br />
155,153,203,223,237,238,247,247,248,247,238,237,235,236,203,220;<br />
<br />
sangre_total; // Part¡culas de sangre que se han quedado en el mapa<br />
angulo_texto; // Movimiento del texto en las opciones<br />
<br />
LOCAL<br />
estado; // Indicador de la animacion actual<br />
paso; // Paso de la animacion actual<br />
inc_y,inc_x; // Desplazamientos del muneco<br />
enemigo; // Identificador del enemigo<br />
tipo_control; // Dispositivo que controla al muneco<br />
energia; // energia de muneco<br />
<br />
PRIVATE<br />
codigo_mapa; // Pantalla de fondo cargada en ese momento<br />
codigo_mapa2;<br />
contador0; // Contador de uso general<br />
idtexto;<br />
<br />
BEGIN<br />
set_mode(m640x480); // Selecciona modo de v¡deo<br />
//max_process_time=1500; // Deja mas tiempo para que se ejecuten los procesos<br />
priority=-10; // Pone muy poca prioridad<br />
<br />
intro(); // Ejecuta la intro del juego<br />
FRAME; // Necesario para parar este proceso<br />
LOOP // Bucle principal<br />
<br />
set_fps(100,0); // Numero de imagenes por segundo<br />
codigo_mapa=load_map("fostiator/MENU.MAP"); // Carga la pantalla del menu<br />
load_pal("fostiator/MENU.MAP");<br />
put_screen(0,codigo_mapa); // Pone la pantalla del menu<br />
unload_map(0,codigo_mapa); // Y la descarga de memoria para as¡ tener mas<br />
<br />
fade_on(); // Enciende la pantalla<br />
<br />
opcion=0; // Inicializa la variable de opciones<br />
<br />
WHILE (opcion==0) // Bucle del menu de presentacion<br />
IF (key(_1) OR<br />
key (_enter)) opcion=1; END // Juego<br />
IF (key(_2) OR key (_esc)) opcion=2; END // Salir<br />
FRAME;<br />
END<br />
<br />
fade_off(); // Apaga la pantalla<br />
<br />
IF (opcion==2) // Opcion elegida: Salir del juego<br />
creditos(); // Pone los creditos<br />
signal(id,s_kill); // Elimina este proceso<br />
FRAME; // Y acaba.<br />
END<br />
<br />
// Carga los graficos de la pantalla de opciones<br />
codigo_mapa=load_map("fostiator/OPCIONES.MAP");<br />
load_pal("fostiator/OPCIONES.MAP");<br />
put_screen(0,codigo_mapa); // Pone el grafico de fondo<br />
unload_map(0,codigo_mapa); // Descarga el grafico de memoria<br />
<br />
opcion=0; // Inicializa la variable de opciones<br />
angulo_texto=0; // Pone a cero el angulo de desplazamiento del texto seleccionado<br />
muestra_informacion(); // Imprime todos los textos y graficos<br />
fade_on(); // Enciende la pantalla<br />
<br />
set_fps(32,0); // Numero de imagenes por segundo<br />
<br />
LOOP<br />
// Mueve el texto que este seleccionado en ese momento<br />
move_text(texto[opcion].codigo,texto[opcion].x+get_disty(angulo_texto,8),texto[opcion].y);<br />
opcion_anterior=opcion; // Guarda la opcion para no cambiar bruscamente<br />
<br />
// Lee las teclas<br />
IF (key(_right) OR key(_down))<br />
opcion++;<br />
END<br />
IF (key(_left) OR key(_up))<br />
opcion--;<br />
END<br />
<br />
// Se ha cambiado a otra opcion<br />
IF (opcion<>opcion_anterior)<br />
<br />
// Espera a que se pare<br />
WHILE (get_disty(angulo_texto,8)<>0)<br />
angulo_texto+=22500;<br />
move_text(texto[opcion_anterior].codigo,<br />
texto[opcion_anterior].x+get_disty(angulo_texto,8),<br />
texto[opcion_anterior].y);<br />
FRAME;<br />
END<br />
<br />
// Normaliza las opciones<br />
IF (opcion==7) opcion=0; END<br />
IF (opcion==-1) opcion=6; END<br />
<br />
// Espera a soltar la tecla<br />
WHILE (key(_right) OR key(_down) OR key(_left) OR key(_up))<br />
FRAME;<br />
END<br />
ELSE<br />
angulo_texto+=22500; // Sigue moviendo el texto<br />
END<br />
<br />
// Se ha elegido una opcion<br />
IF (key(_enter) OR key(_space) OR key (_control))<br />
SWITCH(opcion)<br />
<br />
// Empieza el juego<br />
CASE 0: BREAK; END<br />
<br />
// Modo de juego (1/2 jugadores)<br />
CASE 1:<br />
modo++;<br />
IF (modo==4) modo=0; END<br />
END<br />
<br />
// Nivel de juego (Facil/Dif¡cil)<br />
CASE 2:<br />
nivel++;<br />
IF (nivel==3) nivel=0; END<br />
END<br />
<br />
// Nivel de aparicion de sangre<br />
CASE 3:<br />
sangre++;<br />
IF (sangre==3) sangre=0; END<br />
END<br />
<br />
// Selecciona muneco del jugador 1<br />
CASE 4:<br />
luchador1++;<br />
IF (luchador1==4) luchador1=0; END<br />
END<br />
<br />
// Selecciona el escenario<br />
CASE 5:<br />
escenario++;<br />
IF (escenario==3) escenario=0; END<br />
END<br />
<br />
// Selecciona muneco del jugador 2<br />
CASE 6:<br />
luchador2++;<br />
IF (luchador2==4) luchador2=0; END<br />
END<br />
END<br />
muestra_informacion(); // Actualiza la informacion de pantalla<br />
WHILE (key(_enter) OR key(_space) OR key (_control)) // Espera a soltar la tecla<br />
FRAME;<br />
END<br />
END<br />
IF (key(_esc)) // Se ha pulsado 'escape'<br />
esc_pulsado=1;// Pone variable a 1 la variable de escape pulsado<br />
BREAK; // Y sale del bucle<br />
END<br />
FRAME;<br />
END<br />
<br />
IF (esc_pulsado) // Sale del menu de opciones si se pulso escape<br />
esc_pulsado=0; // Pone a a cero la variable para la proxima vez<br />
fade_off(); // Apaga la pantalla<br />
let_me_alone(); // Deja unicamente el proceso principal(este)<br />
delete_text(all_text);//Borra cualquier texto que hubiera<br />
CONTINUE; // Sale del siguiente bucle<br />
END<br />
// Carga los graficos necesarios para el escenario elegido<br />
SWITCH (escenario)<br />
CASE 0:<br />
codigo_mapa=load_map("fostiator/FONDO1.MAP");<br />
codigo_mapa2=load_map("fostiator/PAISAJE1.MAP");<br />
END<br />
CASE 1:<br />
codigo_mapa=load_map("fostiator/FONDO2.MAP");<br />
codigo_mapa2=load_map("fostiator/PAISAJE2.MAP");<br />
END<br />
CASE 2:<br />
codigo_mapa=load_map("fostiator/FONDO3.MAP");<br />
codigo_mapa2=load_map("fostiator/PAISAJE1.MAP");<br />
END<br />
END<br />
<br />
// Carga los graficos necesarios para el jugador 1<br />
SWITCH(luchador1)<br />
CASE 0: load_fpg("fostiator/MUJER.FPG"); END<br />
CASE 1: load_fpg("fostiator/HOMBRE1.FPG"); END<br />
CASE 2: load_fpg("fostiator/ESQUELET.FPG"); END<br />
CASE 3: load_fpg("fostiator/HOMBRE2.FPG"); END<br />
END<br />
<br />
// Carga los graficos necesarios para el jugador 2<br />
SWITCH(luchador2)<br />
CASE 0: load_fpg("fostiator/MUJER.FPG"); END<br />
CASE 1: load_fpg("fostiator/HOMBRE1.FPG"); END<br />
CASE 2: load_fpg("fostiator/ESQUELET.FPG"); END<br />
CASE 3: load_fpg("fostiator/HOMBRE2.FPG"); END<br />
END<br />
<br />
// Si los jugadores son iguales convierte uno de ellos a grises<br />
IF (luchador1==luchador2)<br />
FROM contador0=1 TO 54;<br />
// Cambia los 54 primeros graficos del fichero<br />
// a la paleta de grises<br />
convert_palette(2,contador0,&grises);<br />
END<br />
convert_palette(2,100,&grises);// Tambin convierte los graficos<br />
convert_palette(2,101,&grises);// pequenos de las carras<br />
END<br />
<br />
combates1=0; // Inicializa las variables del juego<br />
combates2=0;<br />
sangre_total=0;<br />
<br />
REPEAT // Bucle del juego<br />
<br />
fade_off(); // Apaga la pantalla<br />
<br />
// Borra los textos, procesos o 'scrolles' que hubiera abiertos<br />
let_me_alone();<br />
delete_text(all_text);<br />
stop_scroll(0);<br />
clear_screen();<br />
<br />
// Selecciona el numero de pantallas por segundo y el tipo de restauracion<br />
set_fps(100,0);<br />
restore_type=complete_restore;<br />
<br />
// Pone la pantalla a blanco<br />
fade(200,200,200,8);<br />
WHILE (fading) FRAME; END //Espera mientras enciende la pantalla<br />
<br />
// Cambia el tipo de restauracion de pantalla para ganar velocidad<br />
restore_type=no_restore;<br />
<br />
estado_juego=0; // Para el juego para poner todo<br />
<br />
// Inicializa el scroll<br />
start_scroll(0,0,codigo_mapa,codigo_mapa2,0,0);<br />
scroll.x0=160;<br />
<br />
// Crea los munecos que se han seleccionado<br />
// y el tipo de control de los mismos<br />
SWITCH(modo)<br />
<br />
// Ordenador contra ordenador<br />
CASE 0:<br />
id_luchador1=muneco(260,440,1,1,control_ordenador,luchador1);<br />
id_luchador2=muneco(700,440,2,0,control_ordenador,luchador2);<br />
END<br />
<br />
// Jugador contra ordenador<br />
CASE 1:<br />
id_luchador1=muneco(260,440,1,1,control_teclado1,luchador1);<br />
id_luchador2=muneco(700,440,2,0,control_ordenador,luchador2);<br />
END<br />
<br />
// Ordenador contra jugador<br />
CASE 2:<br />
id_luchador1=muneco(260,440,1,1,control_teclado2,luchador1);<br />
id_luchador2=muneco(700,440,2,0,control_ordenador,luchador2);<br />
END<br />
<br />
// Jugador contra jugador<br />
CASE 3:<br />
id_luchador1=muneco(260,440,1,1,control_teclado2,luchador1);<br />
id_luchador2=muneco(700,440,2,0,control_teclado1,luchador2);<br />
END<br />
END<br />
<br />
// Inicializa las variables enemigo de los munecos que son<br />
// identificadores al proceso del enemigo<br />
id_luchador1.enemigo=id_luchador2;<br />
id_luchador2.enemigo=id_luchador1;<br />
<br />
objetos(0,320,49,200,0,0); // Pone los marcadores de energia<br />
objetos(0,194,38,201,0,1);<br />
objetos(0,446,38,202,0,2);<br />
<br />
define_region(1,0,0,640,480); // Define las regiones para el movimiento<br />
define_region(2,0,0,640,480); // de pantalla<br />
<br />
// Escribe el nombre del escenario<br />
write(1,320,0,1,escenarios[escenario]);<br />
<br />
// Pone las fotos y los nombres de los munecos<br />
objetos(id_luchador1.file,44,52,100+combates2,1,0);<br />
write(1,45,100,1,nombres[luchador1]);<br />
objetos(id_luchador2.file,596,52,100+combates1,0,0);<br />
write(1,596,100,1,nombres[luchador2]);<br />
<br />
// Crea las estrellas que marcan los combates ganados<br />
crea_estrellas();<br />
<br />
// Pone el mensaje de inicio de combate<br />
SWITCH(combates1+combates2)<br />
CASE 0:<br />
idtexto=write(2,320,200,4,"ASALTO 1");<br />
END<br />
CASE 1:<br />
idtexto=write(2,320,200,4,"ASALTO 2");<br />
END<br />
CASE 2:<br />
idtexto=write(2,320,200,4,"ASALTO 3");<br />
END<br />
END<br />
<br />
fade(100,100,100,10); // Muestra la pantalla<br />
WHILE (fading) FRAME; END<br />
<br />
// Dependiendo del nivel el juego va mas o menos rapido<br />
set_fps(default_fps+nivel*2,8);<br />
FRAME(4800); // Hace una pequena pausa<br />
<br />
// Borra el texto de inicio de combate<br />
delete_text(idtexto);<br />
<br />
estado_juego=1; // Quita la pausa al juego<br />
<br />
REPEAT // Bucle de cada combate<br />
<br />
// Coloca el scroll dependiendo de las posiciones de los luchadores<br />
scroll.x0=(id_luchador1.x+id_luchador2.x)/4-80;<br />
FRAME;<br />
<br />
// Actualiza los marcadores<br />
define_region(1,296-id_luchador1.energia,28,id_luchador1.energia+1,20);<br />
define_region(2,345,29,id_luchador2.energia+1,20);<br />
<br />
// Comprueba si se ha pulsado 'escape'<br />
IF (key(_esc)) esc_pulsado=1; END<br />
<br />
// Repite hasta que se pulse escape o gane algun luchador<br />
UNTIL (estado_juego==2 OR esc_pulsado)<br />
<br />
// Si no se ha pulsado escape es que alguno ha ganada<br />
IF (NOT esc_pulsado)<br />
IF (id_luchador1.energia==0) // Gana el jugador 2<br />
combates2++;<br />
ELSE<br />
combates1++; // Gana el jugador 1<br />
END<br />
crea_estrellas(); // Actualiza las estrellas<br />
FRAME(4800);<br />
END<br />
<br />
// Repite hasta que algun jugador gane dos combates<br />
UNTIL (combates1==2 OR combates2==2 OR esc_pulsado)<br />
<br />
// Si no se ha pulsado 'escape' pon el final de la lucha<br />
IF (NOT esc_pulsado)<br />
<br />
// Pon el numero de imagenes por segundo como en el menu<br />
set_fps(100,0);<br />
<br />
fade(200,200,200,10); // Pone la pantalla a blanco<br />
WHILE (fading) FRAME; END // Espera hasta que se ponga blanca<br />
<br />
// Pone el nombre del que ha ganado<br />
IF (combates1==2)<br />
write(2,320,160,4,nombres[luchador1]);<br />
ELSE<br />
write(2,320,160,4,nombres[luchador2]);<br />
END<br />
<br />
// Y el mensaje de gana<br />
write(2,320,220,4,"GANA");<br />
<br />
fade(100,100,100,10); // Enciende pantalla<br />
WHILE (fading) FRAME; END // Espera hasta que se encienda<br />
<br />
// Pone el numero de imagenes por segundo como en el juego<br />
set_fps(default_fps+nivel*2,8);<br />
<br />
FRAME(9600); // Espera un rato<br />
<br />
ELSE<br />
// Actualiza la variable que guarda la pulsacion de 'escape'<br />
esc_pulsado=0;<br />
END<br />
<br />
fade_off(); // Apaga la pantalla<br />
<br />
// Inicializa todo, borra procesos, textos pendientes, scrolles, etc<br />
stop_scroll(0); // Para scroll<br />
unload_fpg(1); // Descarga ficheros de graficos<br />
unload_fpg(2);<br />
unload_map(0,codigo_mapa); // Descarga mapas graficos<br />
unload_map(0,codigo_mapa2);<br />
let_me_alone(); // Borra procesos<br />
delete_text(all_text); // Borra textos<br />
<br />
// Cambia la forma de restaurar la pantalla<br />
restore_type=complete_restore;<br />
<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso muestra_informacion<br />
// Pone los textos y los graficos de la pantalla de opciones<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS muestra_informacion()<br />
BEGIN<br />
// Borra todo para luego imprimirlo actualizado<br />
delete_text(all_text); // Borra cualquier texto pendiente<br />
<br />
if(id_luchador1 != 0)<br />
signal(id_luchador1,s_kill); // Elimina los procesos de los munecos<br />
end;<br />
if(id_luchador2 != 0)<br />
signal(id_luchador2,s_kill);<br />
end;<br />
if(id_auxiliar != 0)<br />
signal(id_auxiliar,s_kill);<br />
end;<br />
<br />
// Pone los textos no seleccionables<br />
write(2,320,0,1,"OPTIONS");<br />
write(2,320,156,1,"VS");<br />
<br />
// Pone textos seleccionables<br />
texto[0].codigo=write(2,320,480,7,"FIGHT!");<br />
texto[1].codigo=write(1,320,90,1,modos[modo]);<br />
texto[2].codigo=write(1,320,120,1,niveles[nivel]);<br />
texto[3].codigo=write(1,320,150,1,sangres[sangre]);<br />
<br />
// Pone los graficos de los munecos y del escenario elegidos<br />
id_luchador1=objetos(0,100,256,310+luchador1,1,0);<br />
id_luchador2=objetos(0,540,256,310+luchador2,0,0);<br />
id_auxiliar=objetos(0,320,300,300+escenario,0,0);<br />
<br />
// Pone los textos de los munecos y del escenario elegido<br />
texto[4].codigo=write(1,100,364,1,nombres[luchador1]);<br />
texto[5].codigo=write(1,320,364,1,escenarios[escenario]);<br />
texto[6].codigo=write(1,540,364,1,nombres[luchador2]);<br />
<br />
// Mueve el texto que esta seleccionado<br />
move_text(texto[opcion].codigo,<br />
texto[opcion].x+get_disty(angulo_texto,8),<br />
texto[opcion].y);<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso control<br />
// Mueve los munecos, bien por teclado o controlados por el ordenador<br />
// Entradas: 'accion' : Accion a comprobar si se hace<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS control(accion)<br />
PRIVATE<br />
dist; // Distancia entre los munecos<br />
<br />
BEGIN<br />
<br />
// Comprueba que el juego no este en pausa<br />
IF (estado_juego<>1) return(0); END<br />
<br />
// Lee la tecla dependiendo del tipo de control<br />
SWITCH(father.tipo_control) // Mira quien maneja el muneco<br />
<br />
CASE control_teclado1: // Si se controla con el teclado1<br />
<br />
// Va mirando que accion se quiere hacer<br />
// Y leyendo las teclas que se usan para ello<br />
SWITCH(accion) // Mira que accion se esta comprobando<br />
CASE saltar:<br />
RETURN(key(_up)); // Devuelve TRUE si esta pulsada la tecla<br />
END<br />
CASE agacharse:<br />
RETURN(key(_down));<br />
END<br />
CASE avanzar:<br />
IF (father.flags) // Dependiendo hacia donde mire<br />
RETURN(key(_right)); // Lee una tecla...<br />
ELSE<br />
RETURN(key(_left)); // O la otra<br />
END<br />
END<br />
CASE retroceder:<br />
IF (father.flags)<br />
RETURN(key(_left));<br />
ELSE<br />
RETURN(key(_right));<br />
END<br />
END<br />
CASE golpear:<br />
RETURN(key(_control));<br />
END<br />
END<br />
END<br />
CASE control_teclado2: // Se esta usando el teclado 2<br />
SWITCH(accion) // Se comprueba igual que antes.<br />
CASE saltar:<br />
RETURN(key(_q));<br />
END<br />
CASE agacharse:<br />
RETURN(key(_a));<br />
END<br />
CASE avanzar:<br />
IF (father.flags)<br />
RETURN(key(_t));<br />
ELSE<br />
RETURN(key(_r));<br />
END<br />
END<br />
CASE retroceder:<br />
IF (father.flags)<br />
RETURN(key(_r));<br />
ELSE<br />
RETURN(key(_t));<br />
END<br />
END<br />
CASE golpear:<br />
RETURN(key(_x));<br />
END<br />
END<br />
END<br />
CASE control_ordenador: // Lo maneja el ordenador<br />
dist=abs(id_luchador1.x-id_luchador2.x); // Halla la distancia entre los munecos<br />
SWITCH(father.estado) // Mira que se quiere comprobar<br />
<br />
// Va mirando que accion se quiere hacer<br />
// Y se comprueba si es conveniente<br />
CASE _parado:<br />
SWITCH(accion)<br />
CASE saltar:<br />
// Si se esta a distancia correcta y...<br />
// da la suerte devuelve TRUE<br />
IF (dist<160 AND rand(0,35)==0)<br />
RETURN(1);<br />
END<br />
END<br />
CASE agacharse: // Igual para las demas acciones<br />
IF (dist<160 AND rand(0,25)==0)<br />
RETURN(1);<br />
END<br />
END<br />
CASE avanzar:<br />
IF (dist>400)<br />
IF (rand(0,4)==0)<br />
RETURN(1);<br />
END<br />
ELSE<br />
IF (dist>120 AND rand(0,8)==0)<br />
RETURN(1);<br />
END<br />
END<br />
END<br />
CASE retroceder:<br />
IF (dist<180 AND rand(0,25)==0)<br />
RETURN(1);<br />
END<br />
IF (dist<80 AND rand(0,5)==0)<br />
RETURN(1);<br />
END<br />
END<br />
CASE golpear:<br />
IF (dist<180 AND dist>60 AND rand(0,5)==0)<br />
RETURN(1);<br />
END<br />
END<br />
END<br />
END<br />
CASE _avanzando:<br />
SWITCH(accion)<br />
CASE saltar:<br />
IF (dist>180 AND dist<300 AND rand(0,8)==0)<br />
RETURN(1);<br />
END<br />
END<br />
CASE golpear:<br />
IF (dist<140)<br />
RETURN(1);<br />
END<br />
END<br />
END<br />
END<br />
CASE _retrocediendo:<br />
SWITCH(accion)<br />
CASE saltar:<br />
IF (dist<120 AND rand(0,6)==0)<br />
RETURN(1);<br />
END<br />
END<br />
CASE golpear:<br />
IF (dist>70 AND dist<150)<br />
RETURN(1);<br />
END<br />
END<br />
END<br />
END<br />
CASE _agachado:<br />
SWITCH(accion)<br />
CASE agacharse:<br />
IF (rand(0,5)<>0)<br />
RETURN(1);<br />
END<br />
END<br />
CASE golpear:<br />
IF (dist<180 AND rand(0,5)==0)<br />
RETURN(1);<br />
END<br />
END<br />
END<br />
END<br />
CASE _saltando:<br />
SWITCH(accion)<br />
CASE golpear:<br />
IF (rand(0,10)==0)<br />
RETURN(1);<br />
END<br />
END<br />
END<br />
END<br />
END<br />
// Si la accion es correcta se devuelve 1, si no 0<br />
RETURN(0); // No hace ninguna accion<br />
END<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso muneco<br />
// Maneja todos los tipo de muneco<br />
// Entradas: 'x,y' : Coordenadas iniciales<br />
// 'file' : Fichero donde estan los graficos<br />
// 'flags' : Hacia donde mira el muneco (izq./der.)<br />
// 'tipo_control' : Quien maneja al muneco (teclado1/teclado2/cpu)<br />
// 'luchador' : Cual es de los dos luchadores<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS muneco(x,y,file,flags,tipo_control,luchador)<br />
<br />
PRIVATE<br />
nuevo_estado; // Variable temporal para el estado del muneco<br />
nuevo_paso; // Variable temporal para la posicion de la animacion del muneco<br />
golpe_x,golpe_y; // Variables para guardar los puntos de control de los golpes<br />
// Fuerza de cada uno de los golpes<br />
fuerza_golpe[]=35,35,55,35,35;<br />
contador0; // Contador de uso general<br />
suma_fuerza; // Fuerza variable dependiendo del nivel y del luchador<br />
<br />
BEGIN<br />
ctype=c_scroll; // Lo introduce dentro del scroll<br />
energia=203; // Inicializa la energia<br />
FRAME;<br />
sombra(); // Crea la sombra del muneco<br />
<br />
IF (tipo_control<>0) // Si el ordenador no lleva este muneco<br />
IF (enemigo.tipo_control==0) // Pero lleva el del enemigo<br />
SWITCH(nivel) // Dependiendo del nivel de juego (dificultad)<br />
CASE 1: suma_fuerza=-10; END // Hace que los golpes quiten menos energia<br />
CASE 2: suma_fuerza=-18; END<br />
END<br />
ELSE<br />
suma_fuerza=10; // Humano vs Humano, iguala las fuerzas<br />
END<br />
END<br />
<br />
SWITCH(luchador) // Dependiendo del tipo de luchador<br />
CASE 0: suma_fuerza-=8; END // Ripley pega menos<br />
CASE 1: suma_fuerza+=6; END // Bishop es el segundo que pega mas<br />
CASE 2: suma_fuerza+=4; END // Alien es el segundo que pega menos<br />
CASE 3: suma_fuerza+=8; END // Nostrodomo pega mas que nadie<br />
END<br />
<br />
// Actualiza la fuerza de los golpes segun los jugadores<br />
FROM contador0=0 TO 4; fuerza_golpe[contador0]+=suma_fuerza; END<br />
<br />
LOOP<br />
nuevo_estado=estado; // Actualiza la variable temporal del estado del muneco<br />
SWITCH(estado) // Comprueba el estado del muneco<br />
CASE _parado:<br />
graph=anim0[paso++]; // Anima el grafico<br />
IF (paso==(sizeof(anim0)/sizeof(int))) // Si no hay mas graficos en la animacion<br />
paso=0; // Empieza desde 0<br />
END<br />
IF (flags) // Hace que los munecos se miren<br />
IF (enemigo.x<x) flags=0; END<br />
ELSE<br />
IF (enemigo.x>x) flags=1; END<br />
END<br />
// Comprueba si se quiere cambiar de estado<br />
IF (control(golpear)) // Comprueba si se quiere golpear<br />
nuevo_estado=_punetazo; // Y golpea...<br />
END<br />
IF (control(saltar)) // Comprueba si se quiere saltar<br />
nuevo_estado=_saltando; // Y salta...<br />
inc_y=-16; inc_x=0; // Inicializa los incrementos para el salto<br />
END<br />
IF (control(agacharse)) // Comprueba si se quiere agachar<br />
nuevo_estado=_agachandose; // Y se agacha...<br />
END<br />
IF (control(retroceder)) // Comprueba si se quiere retroceder<br />
nuevo_estado=_retrocediendo;// Y retrocede...<br />
END<br />
IF (control(avanzar)) // Comprueba si se quiere avanzar<br />
nuevo_estado=_avanzando;// Y avanza...<br />
END<br />
END<br />
<br />
CASE _avanzando: // Si se esta avanzando<br />
graph=anim1[paso++]; // Anima el grafico<br />
IF (paso==(sizeof(anim1)/sizeof(int))) // Comprueba que no se ha llegado al final de la animacion<br />
nuevo_estado=_parado; // Y si se ha llegado cambia de estado<br />
END<br />
IF (flags) // Mueve el muneco segun donde mire<br />
x+=4;<br />
ELSE<br />
x-=4;<br />
END<br />
// Comprueba si se quieren hacer otras acciones<br />
IF (control(golpear)) // Se quiere golpear<br />
nuevo_estado=_patada_normal;<br />
END<br />
IF (control(saltar)) // Se quiere saltar<br />
nuevo_estado=_saltando;<br />
inc_y=-16;<br />
IF (flags)<br />
inc_x=12;<br />
ELSE<br />
inc_x=-12;<br />
END<br />
END<br />
END<br />
<br />
CASE _retrocediendo: // Mira si se esta retrocediendo<br />
graph=anim2[paso++]; // Anima el grafico<br />
IF (paso==(sizeof(anim2)/sizeof(int))) // Si se ha llegado al final<br />
nuevo_estado=_parado; // Cambia de estado<br />
END<br />
IF (flags) // Lo mueve segun a donde mire<br />
x-=4;<br />
ELSE<br />
x+=4;<br />
END<br />
// Se mira si se quieren hacer otras acciones posibles<br />
IF (control(golpear))<br />
nuevo_estado=_patada_giratoria;<br />
inc_y=-10;<br />
END<br />
IF (control(saltar))<br />
nuevo_estado=_saltando;<br />
inc_y=-16;<br />
IF (flags)<br />
inc_x=-8;<br />
ELSE<br />
inc_x=8;<br />
END<br />
END<br />
END<br />
<br />
CASE _agachandose: // Comprueba si se esta agachandose<br />
graph=anim3[paso++]; // Haz la animacion<br />
IF (paso==(sizeof(anim3)/sizeof(int))) // Hasta que se llegue al final<br />
nuevo_estado=_agachado; // Y pasa al estado de agachado<br />
END<br />
END<br />
<br />
CASE _agachado: // Comprueba si esta agachado<br />
graph=anim4[0]; // Pone el grafico necesario<br />
IF (flags) // Pone al grafico mirando al otro<br />
IF (enemigo.x<x)<br />
flags=0;<br />
END<br />
ELSE<br />
IF (enemigo.x>x)<br />
flags=1;<br />
END<br />
END<br />
// Comprueba si se quiere hacer otras acciones<br />
IF (control(golpear)) // Comprueba si se quiere golpear<br />
nuevo_estado=_golpe_bajo;<br />
END<br />
IF (NOT control(agacharse)) // Si no quiere agacharse<br />
nuevo_estado=_levantandose; // Se pone levantandose<br />
END<br />
END<br />
<br />
CASE _levantandose: // Comprueba si esta levantandose<br />
graph=anim5[paso++]; // An¡malo<br />
IF (paso==(sizeof(anim5)/sizeof(int))) // Si se acabado<br />
nuevo_estado=_parado; // Cambia de estado a parado<br />
END<br />
END<br />
<br />
CASE _saltando: // Comprueba si se esta saltando<br />
graph=anim6[paso++]; // Anima los graficos<br />
IF (paso>4) // Si se ha llegado al punto de la animacion<br />
x+=inc_x; // Mueve al muneco<br />
y+=inc_y*3;<br />
inc_y+=2; // Cambia el incremento para que bote<br />
IF (y>=440) // Comprueba si ha tocado el suelo<br />
y=440;<br />
polvo(x,y); // Crea polvo cuando cae<br />
// Mira si se quiere saltar otra vez<br />
IF (control(saltar))<br />
nuevo_estado=_parado;<br />
ELSE<br />
nuevo_estado=_agachandose;<br />
END<br />
END<br />
END<br />
IF (control(golpear)) // Comprueba si se quiere golpear<br />
nuevo_estado=_patada_aerea;<br />
nuevo_paso=paso;<br />
END<br />
END<br />
<br />
// Comprueba si se esta se hace el golpe bajo<br />
CASE _golpe_bajo:<br />
graph=anim7[paso++]; // Anima el grafico<br />
IF (paso==(sizeof(anim7)/sizeof(int))) // Si se acaba la animacion<br />
nuevo_estado=_agachado; // Se pone en otro estado<br />
END<br />
IF (flags) // Comprueba hacia donde mira<br />
x++; // Y se mueve un poco<br />
ELSE<br />
x--;<br />
END<br />
// Si se ha llegado al punto de la animacion correcto<br />
IF (paso==2)<br />
sound(s_aire1,rand(50,75),256); // Realiza sonido<br />
get_real_point(1,&golpe_x,&golpe_y); // Coge los puntos de control del puno<br />
golpe(golpe_x,golpe_y,fuerza_golpe[0]); // Y comprueba si se ha tocado<br />
IF (fuerza_golpe[0]>2) // Reduce la fuerza de golpe<br />
fuerza_golpe[0]--; // para la proxima vez<br />
END<br />
END<br />
END<br />
// Comprueba si se esta haciendo la accion punetazo<br />
CASE _punetazo:<br />
graph=anim8[paso++]; // Anima el grafico<br />
IF (paso==(sizeof(anim8)/sizeof(int))) // Hasta que se acabe la animacion<br />
nuevo_estado=_parado; // Y cambia a un nuevo estado<br />
END<br />
IF (flags) // Comprueba hacia donde mira<br />
x++; // Y se mueve<br />
ELSE<br />
x--;<br />
END<br />
IF (paso==4) // Si se ha llegado al punto de la animacion<br />
// Realiza el golpe<br />
sound(s_aire2,rand(50,75),256);<br />
get_real_point(1,&golpe_x,&golpe_y); // Halla el punto donde se dara el golpe<br />
golpe(golpe_x,golpe_y,fuerza_golpe[1]); // Comprueba si se da el golpe<br />
IF (fuerza_golpe[1]>2) // Quita fuerza al golpe<br />
fuerza_golpe[1]--;<br />
END<br />
END<br />
END<br />
<br />
CASE _patada_giratoria: // Comprueba la patada giratoria como los anteriores golpes<br />
graph=anim9[paso++];<br />
IF (paso==(sizeof(anim9)/sizeof(int)))<br />
nuevo_estado=_parado;<br />
END<br />
y+=inc_y; inc_y+=2;<br />
IF (y>440)<br />
y=440;<br />
END<br />
IF (paso==5)<br />
sound(s_aire3,rand(50,75),256);<br />
get_real_point(1,&golpe_x,&golpe_y);<br />
golpe(golpe_x,golpe_y,fuerza_golpe[2]);<br />
IF (fuerza_golpe[2]>2)<br />
fuerza_golpe[2]--;<br />
END<br />
END<br />
END<br />
<br />
CASE _patada_normal: // Comprueba la patada normal<br />
graph=anim10[paso++];<br />
IF (paso==(sizeof(anim10)/sizeof(int)))<br />
nuevo_estado=_parado;<br />
END<br />
IF (paso==4)<br />
sound(s_aire4,rand(50,75),256);<br />
get_real_point(1,&golpe_x,&golpe_y);<br />
golpe(golpe_x,golpe_y,fuerza_golpe[3]);<br />
IF (fuerza_golpe[3]>2)<br />
fuerza_golpe[3]--;<br />
END<br />
END<br />
END<br />
<br />
CASE _patada_aerea: // Comprueba la patada area<br />
graph=anim11[paso++];<br />
IF (paso>4)<br />
x+=inc_x;<br />
y+=inc_y*3;<br />
inc_y+=2;<br />
IF (y>=440)<br />
y=440;<br />
polvo(x,y);<br />
IF (control(saltar))<br />
nuevo_estado=_parado;<br />
ELSE<br />
nuevo_estado=_agachandose;<br />
END<br />
END<br />
END<br />
IF (paso==10 OR paso==19)<br />
sound(s_aire5,rand(50,75),256);<br />
get_real_point(1,&golpe_x,&golpe_y);<br />
golpe(golpe_x,golpe_y,fuerza_golpe[4]);<br />
IF (fuerza_golpe[4]>2)<br />
fuerza_golpe[4]--;<br />
END<br />
END<br />
END<br />
<br />
CASE _tocado: // Comprueba si el muneco ha sido tocado<br />
graph=anim12[paso++]; // anima el grafico<br />
IF (paso==(sizeof(anim12)/sizeof(int))) // Hasta que acabe<br />
// Haz un sonido al azar de los que tiene<br />
SWITCH(rand(0,3))<br />
CASE 0:<br />
sound(s_golpe1,rand(25,50),256);<br />
END<br />
CASE 1:<br />
sound(s_golpe2,rand(25,50),256);<br />
END<br />
CASE 2:<br />
sound(s_golpe3,rand(25,50),256);<br />
END<br />
END<br />
nuevo_estado=_parado; // Cambia de estado<br />
y=440; // Cae al suelo<br />
END<br />
x+=inc_x; // Y mueve el muneco un poco<br />
// Si se movia el muneco, lo frena<br />
IF (inc_x<0) // Si se movia a la izquierda<br />
inc_x++; // Se frena<br />
END<br />
IF (inc_x>0) // Si se movia a la derecha<br />
inc_x--; // Se frena<br />
END<br />
IF (y<440) // Si estaba saltando<br />
y+=8; // Hace que baje<br />
END<br />
IF (y>=440) // Si estaba por debajo del limite inferior<br />
y=440; // Lo coloca<br />
END<br />
END<br />
<br />
CASE _muerto: // Comprueba si el muneco ha muerto<br />
IF (paso==0)<br />
sound(s_muerto,25,256); // Hace el sonido de cuando muere<br />
END<br />
graph=anim13[paso++]; // Anima el grafico hacia con una secuencia<br />
IF (paso==(sizeof(anim13)/sizeof(int))) // Y la deja parada<br />
paso--;<br />
END<br />
x+=inc_x; // Mueve las coordenadas hasta cuadrarlas<br />
// Como el caso anterior (tocado) frena el muneco<br />
IF (inc_x<0)<br />
inc_x++;<br />
END<br />
IF (inc_x>0)<br />
inc_x--;<br />
END<br />
IF (y<440)<br />
y+=8;<br />
END<br />
IF (y>=440)<br />
y=440;<br />
END<br />
END<br />
<br />
END<br />
<br />
IF (estado<>nuevo_estado) // Actualiza el estado del muneco<br />
estado=nuevo_estado;<br />
paso=nuevo_paso; // Y el paso dentro de la animacion<br />
nuevo_paso=0;<br />
END<br />
<br />
IF (x<60) // Comprueba que no se ha salido de pantalla<br />
x=60; // Y coloca el grafico si ha salido<br />
END<br />
IF (x>900)<br />
x=900;<br />
END<br />
<br />
FRAME;<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso sombra<br />
// Maneja la sombra de los munecos<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS sombra()<br />
<br />
BEGIN<br />
ctype=c_scroll; // Lo pone dentro del scroll<br />
graph=1; // Elige el grafico<br />
priority=-1; // Le da prioridad baja para que se ejecute despus<br />
z=1; // Lo pone por debajo del grafico del muneco<br />
y=440; // Inicializa la coordenada vertical<br />
flags=4; // Y hace que sea transparente<br />
LOOP<br />
x=father.x; // Hace que siga al muneco<br />
FRAME;<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso Polvo<br />
// Pone una nube de polvo cuando el muneco cae del salto<br />
// Entradas: Coordenadas donde ira el grafico<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS polvo(x,y)<br />
<br />
BEGIN<br />
FRAME;<br />
ctype=c_scroll; // Lo pone dentro del scroll<br />
flags=4; // Lo hace transparente<br />
z=-1; // Lo pone por delante del muneco<br />
FROM graph=2 TO 12;// Anima el grafico<br />
FRAME;<br />
END // Acaba, eliminando este proceso<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso golpe<br />
// Maneja los golpes que lanzan los munecos<br />
// Entradas: Coordenadas de donde se da realmente el golpe<br />
// 'dano' energia que quita al enemigo<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS golpe(x,y,dano)<br />
<br />
PRIVATE<br />
id_munecos; // Identificador a los munecos<br />
contador0; // Contador de uso general<br />
<br />
BEGIN<br />
ctype=c_scroll; // Introduce al proceso dentro del scroll<br />
z=-1; // Lo pone por delante de los munecos<br />
graph=100; // Elige el grafico de una bola para abarcar mas<br />
// Comprueba si esta tocando a un muneco<br />
id_munecos=collision(type muneco);<br />
IF (id_munecos==father) // Y que no sea l mismo que llamo a este proceso<br />
id_munecos=collision(type muneco); // Si es el mismo intenta coger el otro identificador<br />
END<br />
<br />
IF (id_munecos) // Si ha tocado<br />
// Hace un sonido al azar de los disponibles<br />
SWITCH (rand(0,2))<br />
CASE 0:<br />
sound(s_tocado1,rand(25,75),256);<br />
END<br />
CASE 1:<br />
sound(s_tocado2,rand(25,75),256);<br />
END<br />
CASE 2:<br />
sound(s_tocado3,rand(25,75),256);<br />
END<br />
END<br />
id_munecos.paso=0; // Actualiza la animacion del que ha sido tocado<br />
id_munecos.energia-=dano/2; // Le quita energia<br />
IF (id_munecos.energia<=0) // Si no le queda energia<br />
id_munecos.energia=0; // Es que esta muerto<br />
id_munecos.estado=_muerto;<br />
estado_juego=2;<br />
ELSE<br />
id_munecos.estado=_tocado; // Si no, esta simplemente tocado<br />
END<br />
IF (id_munecos.flags) // Mueve el grafico un poco para atras<br />
id_munecos.inc_x=-8;<br />
ELSE<br />
id_munecos.inc_x=8;<br />
END<br />
SWITCH(sangre) // Crea la sangre<br />
// Dependiendo del nivel elegido en las opciones<br />
CASE 0: // Golpe sin sangre<br />
golpe_sin_sangre(x,y);<br />
END<br />
CASE 1: // Golpe con sangre<br />
contador0=dano/3+1;<br />
WHILE (contador0>0)<br />
particula_sangre(x,y,id_munecos.inc_x+rand(-2,2),rand(-4,0),rand(10,20));<br />
contador0--;<br />
END<br />
END<br />
CASE 2: // Golpe con mucha sangre<br />
contador0=dano+2;<br />
WHILE (contador0>0)<br />
particula_sangre(x,y,id_munecos.inc_x*2+rand(-4,4),rand(-8,2),rand(15,30));<br />
contador0--;<br />
END<br />
END<br />
END<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso particula_sangre<br />
// Maneja la sangre que sale cuando se da un golpe<br />
// Entradas: 'x,y' : Coordenadas desde donde sale la sangre<br />
// 'inc_x,inc_y': Incrementos en el movimiento de la sangre (ca¡da)<br />
// 'cont_tiempo': Contador del tiempo que aparecera la sangre<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS particula_sangre(x,y,inc_x,inc_y,cont_tiempo)<br />
<br />
BEGIN<br />
ctype=c_scroll; // Lo pone dentro del scroll<br />
// Si esta en el modo de mayor sanguinolencia, espera un poco para que no salga toda junta<br />
IF (sangre==2)<br />
FRAME(rand(0,400)); // Espera un tiempo al azar<br />
END<br />
graph=rand(50,53); // Elige uno de los graficos disponibles al azar<br />
flags=4; // La hace transparente<br />
z=-2; // Lo pone por encima de todo<br />
WHILE (cont_tiempo>0) // Mueve la sangre mientras hjaya tiempo<br />
x+=inc_x; // Realiza los incrementos en las coordenadas<br />
y+=inc_y;<br />
inc_y++; // Hace que cada vez caiga mas rapido<br />
IF (inc_x>0) // Pero a horizontalmente se mueva mas lento<br />
inc_x--;<br />
END<br />
IF (inc_x<0)<br />
inc_x++;<br />
END<br />
IF (y>410) // Comprueba si ha tocado el suelo<br />
// Deja sangre pegada al suelo de forma aleatoria<br />
IF (rand(0,80)==0 AND sangre_total<50 AND y<480)<br />
z=256; // La pone detras<br />
sangre_total++; // Incrementa el contador de sangre<br />
LOOP<br />
FRAME; // La deja en un bucle para que quede en pantalla<br />
END<br />
END<br />
END<br />
cont_tiempo--; // Incrementa el contador de tiempo<br />
FRAME;<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso golpe_sin_sangre<br />
// Pone un grafico alternativo al de la sangre para los modos sin ella<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS golpe_sin_sangre(x,y)<br />
<br />
BEGIN<br />
ctype=c_scroll; // Lo pone dentro del scroll<br />
z=-2; // Por delante de otros graficos<br />
FROM graph=60 TO 66;<br />
FRAME; // Anima el grafico<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso objetos<br />
// Pone los graficos estaticos del marcador y la pantalla de opciones<br />
// Entradas: fichero grafico, coordenadas, grafico, bandera (der/izq.),<br />
// zona de la pantalla<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS objetos(file,x,y,graph,flags,region)<br />
<br />
BEGIN<br />
z=10; // Lo pone por debajo de otros graficos<br />
LOOP<br />
FRAME;<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso crea_estrellas<br />
// Maneja las estrellas que indican los combates ganados<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS crea_estrellas()<br />
<br />
BEGIN<br />
// Elimina cualquier estrella que hubiera antes<br />
signal(type estrella,s_kill);<br />
<br />
// Pon las estrellas del jugador 1<br />
SWITCH(combates1)<br />
// Dependiendo de los combates ganados pone unas estrellas u otras<br />
CASE 0:<br />
estrella(111,84,203);<br />
estrella(143,84,203);<br />
END<br />
CASE 1:<br />
estrella(111,84,204);<br />
estrella(143,84,203);<br />
END<br />
CASE 2:<br />
estrella(111,84,204);<br />
estrella(143,84,204);<br />
END<br />
END<br />
<br />
// Pon las estrellas del jugador 2<br />
SWITCH(combates2)<br />
CASE 0:<br />
estrella(530,84,203);<br />
estrella(498,84,203);<br />
END<br />
CASE 1:<br />
estrella(530,84,204);<br />
estrella(498,84,203);<br />
END<br />
CASE 2:<br />
estrella(530,84,204);<br />
estrella(498,84,204);<br />
END<br />
END<br />
<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso estrella<br />
// Imprime los graficos de la estrellas<br />
// Entradas: Coordenadas y tipo de grafico de la estrella<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS estrella(x,y,graph)<br />
<br />
BEGIN<br />
LOOP<br />
FRAME; // Lo imprime<br />
END<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso creditos<br />
// Pone la pantalla de creditos<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS creditos()<br />
<br />
PRIVATE<br />
codigo_mapa; // Identificador al fichero de graficos<br />
// Textos de los creditos<br />
textos[]=<br />
"PROGRAMMER","DANIEL NAVARRO","",<br />
"GRAPHICS","JOSE FERNANDEZ","RAFAEL BARRASO","",<br />
"SFX","ANTONIO MARCHAL","",<br />
"PLAYABILITY","LUIS F. FERNANDEZ","",<br />
"THANKS TO","FERNANDO PEREZ",<br />
"JORGE SANCHEZ","JAVIER CARRION","",<br />
"FOSTIATOR","DIV GAMES STUDIO";<br />
<br />
BEGIN<br />
// Carga la pantalla de fondo<br />
codigo_mapa=load_map("fostiator/CREDITOS.MAP");<br />
load_pal("fostiator/CREDITOS.MAP");<br />
// Y el tipo de letras<br />
load_fnt("fostiator/CREDITOS.FNT");<br />
put_screen(0,codigo_mapa); // Pone el fondo<br />
FROM y=0 TO 19; // Y escribe los textos<br />
write(3,320,40+y*20,4,textos[y]);<br />
END<br />
fade_on(); // Enciende la pantalla<br />
scan_code=0;<br />
REPEAT // Espera hasta que se pulse una tecla<br />
FRAME;<br />
UNTIL (scan_code<>0)<br />
END<br />
<br />
//------------------------------------------------------------------------------<br />
// Proceso intro<br />
// Realiza la intro del juego<br />
//------------------------------------------------------------------------------<br />
<br />
PROCESS intro();<br />
<br />
PRIVATE<br />
contador0; // Contador de uso general<br />
codigo_mapa; // Identificador para descargar los graficos<br />
s_intro; // Identificador del sonido de la intro<br />
BEGIN<br />
// Para el proceso general para poner este<br />
signal(father,s_sleep);<br />
// Hace que la pantalla cambie rapido<br />
set_fps(100,0);<br />
load_pal("fostiator/INTRO.MAP"); // Carga la paleta de colores<br />
codigo_mapa=load_map("fostiator/INTRO.MAP"); // Carga la pantalla<br />
s_intro=load_wav("fostiator/INTROHIT.WAV"); // Carga el sonido<br />
<br />
fade(200,200,200,8); // Pone la pantalla en blanco<br />
WHILE (fading) FRAME; END // Espera hasta que se encienda la pantalla<br />
sound(s_intro,100,256); // Hace el sonido<br />
put_screen(0,codigo_mapa); // Pone el fondo de pantalla<br />
unload_map(0,codigo_mapa); // Descarga el grafico<br />
fade_on(); // Hace que se vea la pantalla (la enciende)<br />
WHILE (fading) FRAME; END // Espera hasta que se encienda la pantalla<br />
<br />
// Carga sonidos<br />
s_golpe1=load_wav("fostiator/UAH00.WAV");<br />
s_golpe2=load_wav("fostiator/WHIMPER2.WAV");<br />
s_golpe3=load_wav("fostiator/WHIMPER3.WAV");<br />
s_tocado1=load_wav("fostiator/HIT00.WAV");<br />
s_tocado2=load_wav("fostiator/HIT01.WAV");<br />
s_tocado3=load_wav("fostiator/HIT02.WAV");<br />
s_aire1=load_wav("fostiator/TURN06.WAV");<br />
s_aire2=load_wav("fostiator/TURN07.WAV");<br />
s_aire3=load_wav("fostiator/TURN08.WAV");<br />
s_aire4=load_wav("fostiator/TURN05.WAV");<br />
s_aire5=load_wav("fostiator/TURN09.WAV");<br />
s_muerto=load_wav("fostiator/AAAH01.WAV");<br />
<br />
// Carga los graficos y las letras<br />
load_fpg("fostiator/JUEGO.FPG");<br />
load_fnt("fostiator/ENJUEGO.FNT");<br />
load_fnt("fostiator/ENJUEGO2.FNT");<br />
<br />
// Espera a que se pulse una tecla o pase un tiempo<br />
WHILE (NOT key(_esc) AND NOT key (_space) AND contador0<200)<br />
FRAME;<br />
contador0++;<br />
END<br />
// Devuelve el control al proceso principal<br />
signal(father,s_wakeup);<br />
END<br />
<br />
<br />
</pre></div>Josebagarhttps://wiki.bennugd.org/index.php?title=WIP&diff=7745WIP2009-11-11T13:41:40Z<p>Josebagar: Creation of a WIP page for BennuGD games</p>
<hr />
<div>[[Index|'''Up to Index''']]<br />
<br />
[[WIP|'''Work In Progress projects''']]<br />
<br />
----<br />
<br />
List of Work In Progress games made with Bennu.<br />
<br />
----<br />
<DPL><br />
category=WIP<br />
mode=userformat<br />
listseparators = ,\n* [[%PAGE%|%TITLE%]],,<br />
redirects = include<br />
noresultsheader = No projects here yet.<br />
resultsfooter = \n%PAGES% games<br />
</DPL></div>Josebagarhttps://wiki.bennugd.org/index.php?title=Windgate%27s_tutorial&diff=7458Windgate's tutorial2009-10-05T12:57:41Z<p>Josebagar: /* The data type associated to the process */ Added the lst paragraph.</p>
<hr />
<div>[[Category:general]]<br />
[[Category:tutorials]]<br />
<br />
[[Image:Trinit_Logo.png|300px|thumb|right|[http://trinit.es/ Trinit association logo]]]<br />
<br />
This tutorial, originally made by Windgate for [http://trinit.es Trinit], tries to serve as a great starting point for those new to [[Bennu]].<br />
<br />
It's still a work in progress, but this article will be updated when new lessons are translated.<br />
<br />
__TOC__<br />
<br />
= Graphics I =<br />
<br />
When creating a video game, the first thing you'll need is graphics.<br />
<br />
You could start with simple graphics made with Paint or a similar simple drawing program, but if you're going to take use several hours of work for your video-game, it's better to start with some nice graphics as can be your preferred game characters or the scenarios for that old game you spent hundreds of hours playing long ago.<br />
<br />
First of all, create a folder where you'll store your work.<br />
<br />
== Sprites ==<br />
<br />
A spriteset is a table of graphics with all the animations for a particular character.<br />
<br />
[[Image:Windgate_tuto_image_1-1.png|392px|thumb|right|1-1 Spriteset Example]]<br />
<br />
You'll have to choose several spritesets. You can find a great collection of spritesets on the Internet, be it in sites as http://spritedatabase.net or simply by searching in Google Images for “sprite” and “ripped”. <br />
<br />
When choosing your spritesets please take into account:<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
| '''Views'''<br />
| Top, side or isometric. It's usually easier to start with side-view spritesets.<br />
|-<br />
| '''Animations'''<br />
| Your character should NOT be able to perform more actions than those defined in its spriteset.<br />
|-<br />
| '''Resolutions'''<br />
| The size in pixels of each animation (Sprite) is a good indication of the quality of the animation.<br />
|}<br />
<br />
Notice that Image I corresponds to an isometric-view spriteset, without any jump animation and with a medium resolution: not as high as that found in Street Fighter II nor as low as that found in the first Super Mario Bros.<br />
<br />
<br />
== Backgrounds ==<br />
<br />
Background images are the images where your game's action will take place.<br />
<br />
[[Image:Windgate_tuto_image_1-2.png|320px|thumb|left|1-2 Spriteset Example]]<br />
<br />
You should choose several background images. Again, have a look at websites such as http://vgmaps.com, or look for them in Google Images using “scroll”, “background” and “ripped” as keywords.<br />
<br />
Just like sprites, background images can also use one of the views listed above so be sure to choose one that uses the same view as your sprites do. As stated above, it's better to start with a side-view game.<br />
<br />
Regarding resolution, try to not use images with a very low resolution (below 320x240 pixels) as they might not fill the screen completely but also be sure not to use images that are too big (over 4096x4096 pixels) as they use too many resources and they could decrease your game's performance. We can always rescale the graphics, but that's something we'll try to avoid as of now.<br />
<br />
Please note that background imagess and sprites are completely different things. In ripped background images you might sometimes find enemies or items kept from the original games, those are useless to us and are called “dirty”, as you'll probably have to clean them before using them in your game.<br />
<br />
Please note that in Image 2 can be a top-view background image, at a somewhat low resolution and that can be considered dirty if your idea is to make a game where the bushes can be cut down.<br />
<br />
<br />
= PUBLIC =<br />
<br />
We've already worked with most of Bennu's main utilities, but there's still a very important aspect of Bennu we have not dealt with that will certainly open you the doors to a very broad field of Bennu programming.<br />
<br />
You can see that, by using PRIVATE variables, you cannot access data belonging to a process even if you know its process ID. That limitation makes it hard to guess things as simple as -for example- determining how much damage a certain shot makes in a certain enemy.<br />
<br />
You could implement such a feature by using LOCAL variables, but this is discouraged as it modifies all the processes' varspace to hold that variable, no matter what their type is, thus increasing the amount of memory used.<br />
<br />
To avoid that problem you can use variables with PUBLIC scope that only modify the varspace of those processes that have that variable declared. Its usage seems to be very simple and convenient but has a few rules that must be followed, as shown below.<br />
<br />
<br />
== DECLARE sentence ==<br />
<br />
Although you can declare the PUBLIC variables in the same way you do with PRIVATE variables that won't generally allow us to access them, as Bennu will give that process type a pre-defined varspace and only contains some basic vars like graph, x, y, etc.<br />
<br />
To overcome this limitation, Bennu implements the DECLARE sentence. You must use it for all the processes that declare PUBLIC variables and before the process declaration. In the example, we're going to declare some PUBLIC data for our main character and thus, before declaring its process we must add the following lines:<br />
<br />
<pre><br />
DECLARE PROCESS main_character ( <Parameters for this process> )<br />
PUBLIC<br />
int health;<br />
int strength;<br />
int agility;<br />
END<br />
END<br />
</pre><br />
<br />
You can include that sentence right before declaring the main_character process. For that process, it'll be like if the variables had been declared in their PRIVATE scope but, as you'll now see, the rest of the game's processes can now access and modify them.<br />
<br />
== The data type associated to the process ==<br />
<br />
The DECLARE sentence not only associates the new vars to the process but it also changes the process identifier so we can have access to them.<br />
<br />
Up until now, the process identifier was stored in a variable of type integer (INT) and we could access its basic data (x, y, size, etc) as if it was of a TYPE variable.<br />
<br />
This continues to be like that and you'll be able to use the identifier for the process like before but we'll now have another new data type that allows us to access all the PUBLIC variables for that process in the same way.<br />
<br />
The new data type created by DECLARE is named after the process so in our case main_character will now also represent a valid data type. So now any process can hold a PRIVATE var of type “main_character” and have access to its basic data and all its PUBLIC variables through it.<br />
<br />
But beware: Variables of type “main_character” and all the type vars associated to a process with PUBLIC scope vars in them cannot be modified before having a valid process identifier associated to them.<br />
<br />
What does that mean?<br />
<br />
That means that prior to PUBLIC variables usage, you must store a valid process identifier. For example, any enemy that wants to get the main_processes “health” variable must first declare a PRIVATE variable of type “main_character”, as shown below: <br />
<br />
<pre><br />
PRIVATE<br />
main_character objective;<br />
</pre><br />
<br />
And second, before accessing any of the fields in objective, it must refer to the actual main_character process, and check that the proess still exists. You could do:<br />
<br />
<pre><br />
IF ( objective = collision ( TYPE main_character ) )<br />
objective.health = objective.health - 1;<br />
END<br />
</pre><br />
<br />
Once more, please note that before being able to use objective.health you must check there is a collision and therefore objective holds a valid process identifier.<br />
<br />
And, of course, apart from collision(), you can also use get_id(), father and -in general- any other method that returns a process ID for main_character to work with the new data TYPE returned by DECLARE.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Windgate_tuto_image_1-2.png&diff=7451File:Windgate tuto image 1-2.png2009-09-30T20:03:33Z<p>Josebagar: Image 1-1 for Windgate's tutorial.</p>
<hr />
<div>Image 1-1 for Windgate's tutorial.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Windgate_tuto_image_1-1.png&diff=7450File:Windgate tuto image 1-1.png2009-09-30T19:58:16Z<p>Josebagar: Image 1-1 for Windgate's tutorial.</p>
<hr />
<div>Image 1-1 for Windgate's tutorial.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Trinit_Logo.png&diff=7449File:Trinit Logo.png2009-09-30T19:51:29Z<p>Josebagar: This is the logo for the Trinit association logo.
One of Trinit's members is the author of Windgate's tutorial</p>
<hr />
<div>This is the logo for the Trinit association logo.<br />
One of Trinit's members is the author of [[Windgate's tutorial]]</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Is_playing_song&diff=7440Is playing song2009-09-14T18:40:32Z<p>Josebagar: Fenix -> Bennu</p>
<hr />
<div>[[Category:functions]]<br />
[[Category:sound]]<br />
[[Category:mod_sound]]<br />
<br />
==Definition==<br />
'''INT''' is_playing_song ( )<br />
<br />
Checks to see if Bennu is playing a song file, started with [[play_song]]().<br />
<br />
== Returns ==<br />
'''INT''' : Whether Bennu is playing a song at the moment of calling.<br />
{|<br />
| [[true]] || - Bennu is playing a song.<br />
|-<br />
| [[false]] || - Bennu is not playing a song.<br />
|}<br />
<br />
== Example ==<br />
<pre><br />
program music_example;<br />
global<br />
my_song;<br />
playing;<br />
paused;<br />
faded_in;<br />
v;<br />
begin<br />
set_mode(640,480,16);<br />
<br />
my_song=load_song("beat.ogg");<br />
<br />
write(0,320,30,4,"Use the keyboard to control the music playback.");<br />
write(0,320,50,4,"Key [ENTER] starts / stops the song.");<br />
write(0,320,60,4,"Key [SPACE] pauses / resumes the song.");<br />
write(0,320,70,4,"Key [0] through key [9] changes the song volume.");<br />
write(0,320,80,4,"Key [F] fades the song in or out.");<br />
<br />
write(0,320,120,5,"Playing: ");<br />
write_int(0,320,120,3,&playing);<br />
<br />
write(0,320,140,5,"Paused: ");<br />
write_int(0,320,140,3,&paused);<br />
<br />
write(0,320,160,5,"Faded in: ");<br />
write_int(0,320,160,3,&faded_in);<br />
<br />
write(0,320,180,5,"Volume: ");<br />
write_int(0,320,180,3,&v);<br />
<br />
v=128;<br />
faded_in=true;<br />
<br />
<br />
repeat<br />
if(key(_enter))<br />
if(is_playing_song())<br />
stop_song();<br />
playing=false;<br />
else<br />
play_song(my_song,1);<br />
playing=true;<br />
end<br />
while(key(_enter))frame;end<br />
end<br />
<br />
if(key(_space))<br />
if(paused)<br />
paused=false;<br />
resume_song();<br />
else<br />
paused=true;<br />
pause_song();<br />
end<br />
while(key(_space))frame;end<br />
end<br />
<br />
if(key(_f))<br />
if(faded_in)<br />
faded_in=false;<br />
fade_music_off(100);<br />
else<br />
faded_in=true;<br />
fade_music_in(my_song,1,100);<br />
end<br />
while(key(_f))frame;end<br />
end<br />
<br />
if(key(_0))v=0;end<br />
if(key(_1))v=14;end<br />
if(key(_2))v=28;end<br />
if(key(_3))v=43;end<br />
if(key(_4))v=57;end<br />
if(key(_5))v=71;end<br />
if(key(_6))v=85;end<br />
if(key(_7))v=100;end<br />
if(key(_8))v=114;end<br />
if(key(_9))v=128;end<br />
<br />
set_song_volume(v);<br />
<br />
frame;<br />
until(key(_esc))<br />
<br />
exit();<br />
end<br />
</pre><br />
Used in example: [[key]](), [[set_mode]](), [[load_song]](), [[write]](), [[write_int]](), [[pause_song]](), [[play_song]](), [[stop_song]](), [[resume_song]](), [[fade_music_in]](), [[fade_music_off]](), [[set_song_volume]]().<br />
<br />
{{Funcbox<br />
| category=Sound<br />
}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Synaptic-search-bennugd.png&diff=7433File:Synaptic-search-bennugd.png2009-09-11T18:43:25Z<p>Josebagar: A screenshot showing the synaptic dialog searching for "bennugd".</p>
<hr />
<div>A screenshot showing the synaptic dialog searching for "bennugd".</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Unofficial-bennugd-repo-installation-ubuntu.png&diff=7432File:Unofficial-bennugd-repo-installation-ubuntu.png2009-09-11T18:30:02Z<p>Josebagar: uploaded a new version of "Image:Unofficial-bennugd-repo-installation-ubuntu.png": This is the same version as the prevoous one, but with the program working in English, instead of in Spanish.</p>
<hr />
<div>Screenshot showing the package that adds the BennuGD unofficial repository to a Ubuntu system, with the installation program open.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:BennuGD-running-in-linux-Ubuntu-9.04.png&diff=7377File:BennuGD-running-in-linux-Ubuntu-9.04.png2009-08-10T16:37:35Z<p>Josebagar: BennuGD running in Ubuntu 9.04. This particular screenshot taken in a Ubuntu 9.04 amd64 system, but can be used generically for any Ubuntu 9.04 gnome based system.</p>
<hr />
<div>BennuGD running in Ubuntu 9.04. This particular screenshot taken in a Ubuntu 9.04 amd64 system, but can be used generically for any Ubuntu 9.04 gnome based system.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Synaptic-install-dependencies-ia32.png&diff=7376File:Synaptic-install-dependencies-ia32.png2009-08-10T16:35:58Z<p>Josebagar: Extra dependencies installation for ia32-libs package in Ubuntu 9.04 x86_64.</p>
<hr />
<div>Extra dependencies installation for ia32-libs package in Ubuntu 9.04 x86_64.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Synaptic-search-ia32.png&diff=7375File:Synaptic-search-ia32.png2009-08-10T16:34:52Z<p>Josebagar: Synaptic search for package name ia32 in Ubuntu 9.04 x86_64.</p>
<hr />
<div>Synaptic search for package name ia32 in Ubuntu 9.04 x86_64.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Bennugd-installing-ubuntu.png&diff=7374File:Bennugd-installing-ubuntu.png2009-08-10T16:13:41Z<p>Josebagar: Screenshot of a terminal open in a Ubuntu 9.04 system giving the installation script executalbe rights and launching the Bennu installer through sudo.</p>
<hr />
<div>Screenshot of a terminal open in a Ubuntu 9.04 system giving the installation script executalbe rights and launching the Bennu installer through sudo.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Synaptic-install-dependencies.png&diff=7373File:Synaptic-install-dependencies.png2009-08-10T16:11:57Z<p>Josebagar: Synaptic dialog showing aconfirmation dialog for installing additional dependencies.</p>
<hr />
<div>Synaptic dialog showing aconfirmation dialog for installing additional dependencies.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Synaptic-search-libsdl-mixer.png&diff=7372File:Synaptic-search-libsdl-mixer.png2009-08-10T16:10:47Z<p>Josebagar: Synaptic search for package name libsdl-mixer in Ubuntu 9.04 x86.</p>
<hr />
<div>Synaptic search for package name libsdl-mixer in Ubuntu 9.04 x86.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Synaptic-open.png&diff=7371File:Synaptic-open.png2009-08-10T16:09:51Z<p>Josebagar: Route to open Synaptic in Ubuntu 9.04</p>
<hr />
<div>Route to open Synaptic in Ubuntu 9.04</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Bennugd-downloadpage.png&diff=7363File:Bennugd-downloadpage.png2009-08-09T14:50:40Z<p>Josebagar: This screenshot shows the Bennu download page as seen with Firefox 3.5.2 in a xfce4 desktop system.</p>
<hr />
<div>This screenshot shows the Bennu download page as seen with Firefox 3.5.2 in a xfce4 desktop system.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Setting_up_Bennu_on_64_bit_linux&diff=7360Setting up Bennu on 64 bit linux2009-08-09T14:13:36Z<p>Josebagar: Created redirection to the tutorial</p>
<hr />
<div>#REDIRECT [[Tutorial:Setting up Bennu on 64 bit linux]]</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:BennuGD-running-in-linux.png&diff=7359File:BennuGD-running-in-linux.png2009-08-09T00:08:25Z<p>Josebagar: This screenshot shows a text editor with the source for a simple Bennu demo in it, and that demo compilation log next to it actually running in a fedora core 11 amd64 system.</p>
<hr />
<div>This screenshot shows a text editor with the source for a simple Bennu demo in it, and that demo compilation log next to it actually running in a fedora core 11 amd64 system.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Bennugd-installation-console.png&diff=7358File:Bennugd-installation-console.png2009-08-09T00:06:03Z<p>Josebagar: This screenshot shows a linux terminal with the two commands required to install BennuGD with the official installation script in a standard linux system.</p>
<hr />
<div>This screenshot shows a linux terminal with the two commands required to install BennuGD with the official installation script in a standard linux system.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Bennugd-downloadpage-linux.png&diff=7357File:Bennugd-downloadpage-linux.png2009-08-09T00:03:54Z<p>Josebagar: This screenshot shows firefox browsing the bennugd downloads page from a standard linux system.</p>
<hr />
<div>This screenshot shows firefox browsing the bennugd downloads page from a standard linux system.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:System-additional-dependencies.png&diff=7356File:System-additional-dependencies.png2009-08-09T00:01:53Z<p>Josebagar: This screenshot shows the dialog where the system asks the user for permission to install additional required libraries (in this case mikmod) on a fedora 11 amd64 system.</p>
<hr />
<div>This screenshot shows the dialog where the system asks the user for permission to install additional required libraries (in this case mikmod) on a fedora 11 amd64 system.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:System-install-sdli586.png&diff=7355File:System-install-sdli586.png2009-08-08T23:59:45Z<p>Josebagar: This screenshot shows the selection of the i586 version of the SDL libs on an amd64 fedora core 11 system.</p>
<hr />
<div>This screenshot shows the selection of the i586 version of the SDL libs on an amd64 fedora core 11 system.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:System-addpackages.jpg&diff=7354File:System-addpackages.jpg2009-08-08T23:56:01Z<p>Josebagar: This screenshot shows the route to open the "Add/Remove Packages" feature in Fedora Core 11 on amd64.</p>
<hr />
<div>This screenshot shows the route to open the "Add/Remove Packages" feature in Fedora Core 11 on amd64.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Loops&diff=7317Loops2009-07-22T03:57:40Z<p>Josebagar: /* Manipulating a loop */ Removed note on Fenix 0.85 and below behaviour.</p>
<hr />
<div>[[category:general]]<br />
<br />
== Loops ==<br />
'''LOOP-END''', '''WHILE-END''', '''REPEAT-UNTIL''', '''FOR-END''', '''FROM-END'''<br />
<br />
Loops are used to create iterations in your code. The statements between these words will get repeated depending on a condition. There are several types of loops:<br />
<br />
=== Loop ... End ===<br />
<pre><br />
Loop<br />
// Statements<br />
End<br />
</pre><br />
* The statements will be repeated indefinitely.<br />
<br />
=== While ... End ===<br />
<pre><br />
While(<condition>)<br />
// Statements<br />
End<br />
</pre><br />
* The statements will be repeated while ''condition'' is fulfilled.<br />
<br />
=== Repeat ... Until ===<br />
<pre><br />
Repeat<br />
// Statements<br />
Until(<condition>)<br />
</pre><br />
* The statements will be repeated until ''condition'' is fulfilled.<br />
<br />
=== For ... End ===<br />
<pre><br />
For( [ <initializer> ] ; [ <condition> ] ; [ <counting expression> ] )<br />
// Statements<br />
End<br />
</pre><br />
* First, ''initializer'' will be executed. Then the statements will be repeated until ''condition'' is fulfilled. After each run of the statements, ''counting expression'' is executed.<br />
<br />
=== From ... End ===<br />
<pre><br />
From <variable>=<startvalue> To <endvalue> [ Step <incrementvalue> ] ;<br />
// Statements<br />
End<br />
</pre><br />
* First, ''startvalue'' will be assigned to the variable. Then the statements will be repeated and ''incrementvalue'' added to the variable. When the variable is greater than ''endvalue'', the loop ends. <br />
* Note that ''incrementvalue'' must be a [[constant]]. The <code>Step <incrementvalue></code> part is optional.<br />
<br />
== Manipulating a loop ==<br />
<br />
There are more ways to manipulate a loop, both internally and externally.<br />
<br />
If the code inside a loop reaches a [[break]]; statement, the loop is immediately ended. This is particularly useful in the Loop-End loop, because that one has no other way to end the loop and continue code beneath it.<br />
<br />
If the code inside a loop reaches a [[continue]]; statement, it executes the possible count- or stepping statement and then continues to the checking of the condition. So in a Repeat-Until loop, it would just skip to the Until() part.<br />
<br />
If the loop is run in a specific [[process]], one can influence the execution of the loop, by changing the state of that process, by use of [[signal]]() and [[signals]].<br />
<br />
== Example ==<br />
<pre><br />
import "mod_say"<br />
<br />
Const<br />
startvalue = 1;<br />
endvalue = 8;<br />
incrementvalue = 2;<br />
End<br />
<br />
Process Main()<br />
Private<br />
int c;<br />
Begin<br />
<br />
/* Loop */<br />
<br />
c = startvalue;<br />
Loop<br />
say("Loop: " + c);<br />
c+=incrementvalue;<br />
if(c>endvalue)<br />
break;<br />
end<br />
End<br />
say("End Loop: " + c);<br />
<br />
/* While */<br />
<br />
c = startvalue;<br />
While(c<=endvalue)<br />
say("While: " + c);<br />
c+=incrementvalue;<br />
End<br />
say("End While: " + c);<br />
<br />
/* Repeat */<br />
<br />
c = startvalue;<br />
Repeat<br />
say("Repeat: " + c);<br />
c+=incrementvalue;<br />
Until(c>endvalue)<br />
say("End Repeat: " + c);<br />
<br />
/* For */<br />
<br />
For(c=startvalue;c<=endvalue;c+=incrementvalue)<br />
say("For: " + c);<br />
End<br />
say("End For: " + c);<br />
<br />
/* From */<br />
<br />
From c=startvalue To endvalue Step incrementvalue;<br />
say("From: " + c);<br />
End<br />
say("End From: " + c);<br />
<br />
End<br />
</pre><br />
Used in example: [[say]](), [[constants]], [[loop]], [[if]], [[break]], [[while]], [[repeat]], [[for]], [[from]]<br />
<br />
In the example, all the loops do the same thing, illustrated by the use of the same constants. The output is:<br />
<pre><br />
Loop: 1<br />
Loop: 3<br />
Loop: 5<br />
Loop: 7<br />
End Loop: 9<br />
While: 1<br />
While: 3<br />
While: 5<br />
While: 7<br />
End While: 9<br />
Repeat: 1<br />
Repeat: 3<br />
Repeat: 5<br />
Repeat: 7<br />
End Repeat: 9<br />
For: 1<br />
For: 3<br />
For: 5<br />
For: 7<br />
End For: 9<br />
From: 1<br />
From: 3<br />
From: 5<br />
From: 7<br />
End From: 9<br />
</pre><br />
<br />
{{Keywords}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Pango_render&diff=7315Pango render2009-07-22T03:55:26Z<p>Josebagar: /* Returns */</p>
<hr />
<div>[[Category:functions]]<br />
[[Category:pangodll]]<br />
<br />
This function is part of the [[DLL:Pango.dll|Pango library]].<br />
<br />
== Syntax ==<br />
'''INT''' pango_render ( <'''STRING''' markup> )<br />
<br />
== Description ==<br />
Returns a [[graphic]] with the specified markup rendered on it. The markup is expected to be a UTF-8 encoded string; markup accepted by the Pango BennuGD binding is the same as upstream Pango's and can be consulted [http://library.gnome.org/devel/pango/stable/PangoMarkupFormat.html here].<br />
<br />
In case of failure, a 0x0 sized graphic will be returned. <br />
<br />
After usage, unload the graphic with [[map_unload]]().<br />
<br />
== Parameters ==<br />
{|<br />
| '''STRING''' markup || - The markup to render to a graphic.<br />
|}<br />
<br />
== Returns ==<br />
'''INT''' : [[GraphID]]<br />
{|<br />
| 0 || - There was some error. Pango tends to drop error on stdout, so check your terminal for them.<br />
|-<br />
| >0 || - The graphID of a new graphic with the specified markup rendered on it.<br />
|}<br />
<br />
== Example ==<br />
<pre><br />
import "mod_say";<br />
import "mod_key";<br />
import "mod_video";<br />
import "mod_map";<br />
import "mod_mouse";<br />
import "mod_text";<br />
<br />
import "pango";<br />
<br />
Process main()<br />
Private<br />
int retval=0;<br />
string markup = '<span foreground="blue" background="black">e=mc<sup>2</sup></span>';<br />
Begin<br />
<br />
set_mode(640, 480, 32, MODE_WINDOW);<br />
<br />
// If given and argument, render that instead of the default text<br />
if(argc == 2)<br />
markup = '<span font_family="Serif" size="xx-large" foreground="blue" background="black"><u>'+argv[1]+'</u></span>';<br />
end;<br />
<br />
say("Going to render:");<br />
say(markup);<br />
<br />
// Render the markup and move it with the mouse<br />
graph = pango_render(markup);<br />
write_var(0, 0, 0, 0, x);<br />
write_var(0, 0, 10, 0, y);<br />
<br />
// Wait for escape key<br />
while(! key(_ESC))<br />
x = mouse.x;<br />
y = mouse.y;<br />
FRAME;<br />
End;<br />
<br />
OnExit<br />
<br />
unload_map(0, graph);<br />
<br />
End<br />
</pre><br />
Used in example: [[import]](), [[set_mode]](), [[say]](), [[pango_render]](), [[write_var]](), [[key]](), [[unload_map]](), [[mouse]]</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Drawing_map&diff=7186Drawing map2009-06-18T16:06:29Z<p>Josebagar: Fenix->Bennu</p>
<hr />
<div>[[Category:functions]]<br />
[[Category:drawing]]<br />
[[Category:mod_draw]]<br />
<br />
==Definition==<br />
'''INT''' drawing_map ( <'''INT''' fileID> , <'''INT''' graphID> )<br />
<br />
Tells [[Bennu]] to draw the coming [[drawing]]s on a certain [[graphic]].<br />
<br />
In order to draw with a certain z value again, [[drawing_z]]() can be used.<br />
<br />
== Parameters ==<br />
{|<br />
| '''INT''' fileID || - The [[fileID]] of the [[file]] that holds the graphic.<br />
|-<br />
| '''INT''' graphID || - The [[graphID]] of the [[graphic]] to draw on.<br />
|}<br />
<br />
== Returns ==<br />
'''INT''' : [[true]]<br />
<br />
{{Funcbox<br />
| category=Drawing<br />
}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Blit_flags&diff=7063Blit flags2009-05-31T00:45:16Z<p>Josebagar: /* Definition */</p>
<hr />
<div>[[Category:constantcategories]]<br />
<br />
== Definition ==<br />
Blit flags are [[bit flags]] which can be passed to some [[:Category:Maps|map functions]], to specify a certain effect when [[blit]]ting a [[graphic]]. These functions are:<br />
* [[xput]]()<br />
* [[map_xput]]()<br />
* [[map_xputnp]]()<br />
<br />
They can also be used to specify a certain effect for the blitting of the graphic of a [[process]], by assigning blit flags to its [[local variable]] [[flags]].<br />
<br />
== List ==<br />
{|<br />
| ''Constant'' || - ''Value'' || - ''Description''<br />
|-<br />
| B_HMIRROR || - 1 || - Blit the graph horizontally mirrored.<br />
|-<br />
| B_VMIRROR || - 2 || - Blit the graph vertically mirrored.<br />
|-<br />
| B_TRANSLUCENT || - 4 || - Blit the graph with half transparency.<br />
|-<br />
| B_ALPHA || - 8 || - Blit the graph in some way. (''What does this do exactly?'')<br />
|-<br />
| B_ABLEND || - 16 || - Blit the graph using additive blending (nice effect for fire).<br />
|-<br />
| B_SBLEND || - 32 || - Blit the graph using subtractive blending (nice effect for ghosting).<br />
|-<br />
| B_NOCOLORKEY || - 128 || - Blit the transparent parts of the graph as black (color 0).<br />
|}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Special:Badtitle/NS114:Setting_up_Fenix_with_Notepad%2B%2B&diff=6863Special:Badtitle/NS114:Setting up Fenix with Notepad++2009-03-20T01:47:25Z<p>Josebagar: Tutorial:Setting up Fenix with Notepad++ moved to Tutorial:Setting up Bennu with Notepad++: Fenix -> Bennu</p>
<hr />
<div>#REDIRECT [[Tutorial:Setting up Bennu with Notepad++]]</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Special:Badtitle/NS114:Setting_up_Bennu_with_Notepad%2B%2B&diff=6862Special:Badtitle/NS114:Setting up Bennu with Notepad++2009-03-20T01:47:24Z<p>Josebagar: Tutorial:Setting up Fenix with Notepad++ moved to Tutorial:Setting up Bennu with Notepad++: Fenix -> Bennu</p>
<hr />
<div>== Setting up Bennu with Notepad++ ==<br />
<br />
<br />
For this tutorial, you must already have downloaded the Bennu binaries to a directory on your computer.<br />
<br />
Throughout the tutorial, the folder name XXXXX will be mentioned; this should be replaced with the directory where your Bennu binaries are located. For example, you might have extracted the binaries to D:\Bennu\Runtime\092a\, then replace XXXXX with D:\Bennu\Runtime\092a (make sure that you don’t have an extra \ on the end – this will confuse Notepad++).<br />
<br />
<br />
== Screenshot ==<br />
<br />
Here is a screenshot of Notepad++ editing a Bennu script, resembling the DIV Games Studio environment:<br />
[[Image:notepadplusplus.jpg]]<br />
<br />
== Advantages ==<br />
<br />
Notepad++ is a completely free source code editor, and can be used as a Windows Notepad replacement. It comes with a range of highlighters for all main programming languages.<br />
<br />
The editor supports auto-completion and code-lookup. Along with other perks, you can zoom in and out of your code, add bookmarks and record macros. Also, the editor will highlight braces and brackets to show what you are currently editing inside.<br />
<br />
When the editor is set up as in this tutorial, all runtime files for your Bennu projects will only need to be in one directory on your computer, this brings advantages like saving disk space, updating a certain file is much easier and automatically affects all programs using it, not just one.<br />
<br />
<br />
== Install Notepad++ ==<br />
<br />
First off, you need to download and install Notepad++ from its website, [http://notepad-plus.sourceforge.net/]. You can find details on the website for how to install. When installed, you need to download some XML files and place them in the Notepad++ directory to make the Bennu highlighter work properly.<br />
<br />
<br />
<br />
== Syntax Highlighter ==<br />
<br />
You need to download [[Notepad++Highlighter.rar]]? and put it in your Notepad++ install directory, overwriting some files. When you edit a Bennu script now, the syntax will be highlighted just like in DIV Games Studio. If you start up Notepad++ from scratch, you will need to click Languages -> Bennu, or you could just save the empty file as a .prg and the program will be recognized as a Bennu script.<br />
<br />
<br />
== Hotkeys ==<br />
<br />
To set up hotkeys to compile and run your Bennu program, you need to do a slight bit of editing of settings and batch files. It is relatively straightforward, and as a programmer, you will be able to do this very easily.<br />
<br />
Firstly, you need to download [[NotepadPlusPlus_BGDC.rar]]? and edit one line of it (you can use Notepad++ to edit the batch file if you want). The line you need to edit is the second line down. At the moment, the line looks something like this: “XXXXX\BGDC.exe” %0 %1 %2 %3 %4 %5 %6 %7 %8 %9<br />
<br />
You need to change the XXXXX to the location of your Bennu runtime (the directory with BGDC.exe and BGDI.exe in. So now the line might read: : “D:\Bennu\Runtime\092a\BGDC.exe” %0 %1 %2 %3 %4 %5 %6 %7 %8 %9<br />
<br />
Remember to include your Bennu directory AND BGDC.exe within quotation marks, and not to include an extra \ at the end.<br />
<br />
Now you can assign a hotkey to Notepad++. Do this from going to the menu Run -> Run… and locate the BGDC.BAT file. At the end of the file name you need to add a few extra words, to make the batch file know what file it is going to compile. Let’s say that the batch file is located at D:\Bennu\Runtime\BGDC.bat, you will need to type the following into the Run dialogue box:<br />
<br />
D:\Bennu\Runtime\BGDC.bat $(FULL_CURRENT_PATH)<br />
<br />
Now you can click Save As, and assign a hot key. A suggested hotkey for this is F6, as most editors use the F6 key to compile.<br />
<br />
To assign another key to run the compiled code, you will need to type the following into the Run dialogue box (assuming your Bennu runtime directory is the same).<br />
<br />
D:\Bennu\Runtime\BGDI.exe $(CURRENT_DIRECTORY)\$(NAME_PART).dcb<br />
<br />
Again, click Save As,a nd assign a hot key. A suggested hotkey for this is F5. But to use F5 for run, you will need to re-map Notepad++’s current use for F5. You can do this by going to Settings -> Shortcut Mapper, and right clicking number 117 and changing it to Shift + F5.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Pango-mingw-win32.zip&diff=6672File:Pango-mingw-win32.zip2009-01-02T19:33:17Z<p>Josebagar: uploaded a new version of "Image:Pango-mingw-win32.zip": This new version includes pango-querymodules.exe, which was missing, sorry.</p>
<hr />
<div>Binary version of pango library for 32 win32, compiled with mingw.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Pango.zip&diff=6662File:Pango.zip2008-12-30T02:09:11Z<p>Josebagar: Pango wrapper for bennu. Includes GPL sources, a Bennu example and a pre-compiled Linux version.</p>
<hr />
<div>Pango wrapper for bennu. Includes GPL sources, a Bennu example and a pre-compiled Linux version.</div>Josebagarhttps://wiki.bennugd.org/index.php?title=Special:Badtitle/NS116:Log.dll&diff=6659Special:Badtitle/NS116:Log.dll2008-12-30T02:02:52Z<p>Josebagar: /* Example */</p>
<hr />
<div>[[Category:dll]]<br />
[[Category:logdll]]<br />
<br />
[[DLLs|'''Up to DLL's''']]<br />
----<br />
<br />
<br />
== Definition ==<br />
Log.dll is a [[DLL]] with [http://en.wikipedia.org/wiki/Logarithm logarithmic] functions, which aren't built into Fenix by default.<br />
<br />
== Example ==<br />
<pre><br />
Import "log";<br />
<br />
Global<br />
float logarithm=0.0;<br />
<br />
Process main()<br />
Begin<br />
write_float(0,160,100,4,&logarithm);<br />
<br />
While(not(key(_esc)))<br />
If (key(_1)) logarithm=log(1000,9); End <br />
If (key(_2)) logarithm=log(1000); End<br />
If (key(_3)) logarithm=log2(1024); End <br />
If (key(_4)) logarithm=ln(13.37); End <br />
<br />
Frame;<br />
End<br />
End<br />
</pre><br />
Used in example: [[import]], [[write_float]](), [[key]](), [[log]](), [[log2]](), [[ln]]()<br />
<br />
== Download ==<br />
* [[Media:log(Fenix0.92a).zip|Log.dll for Fenix 0.92a and 0.93]] (Source & example included)<br />
<br />
== Documentation ==<br />
* [[:Functioncategory:logdll|Log.dll functions]]<br />
<br />
{{Dllbox}}</div>Josebagarhttps://wiki.bennugd.org/index.php?title=BennuGD&diff=6657BennuGD2008-12-27T04:42:24Z<p>Josebagar: Redirecting to Bennu</p>
<hr />
<div>#REDIRECT [[Bennu]]</div>Josebagarhttps://wiki.bennugd.org/index.php?title=File:Ttf.dll_(BennuGD_WIP_17).zip&diff=6655File:Ttf.dll (BennuGD WIP 17).zip2008-12-27T04:19:11Z<p>Josebagar: This is the TTF library updated to work with BennuGD WIP 17.
Tested on linux.
Sorry but it doesn't contain a Makefile, but a compile script that you must edit minimally to make it work. Help on this is appreciated.</p>
<hr />
<div>This is the TTF library updated to work with BennuGD WIP 17.<br />
Tested on linux.<br />
<br />
Sorry but it doesn't contain a Makefile, but a compile script that you must edit minimally to make it work. Help on this is appreciated.</div>Josebagar