Autor Tema: I just can't get into Bennu :(  (Leído 4281 veces)

Toxic_death

  • Newbie
  • *
  • Mensajes: 3
  • Karma: 0
I just can't get into Bennu :(
« en: Agosto 31, 2009, 01:41:26 pm »
Hi.

I want to start programming with Bennu but there's only one huge problem annoying me.

There are no real tutorials. :(
I already read through the beginners tutorial found on the wiki (what does "frame;" do?...) but that doesn't really help. I already know about Integers, Strings, variables and stuff from TurboPascal. The tutorial doesn't explain how to realize something, like for example loading a sprite and moving it around with buttons.
I know there's already a shoot-em-up tutorial but I don't understand it, yet.

So could somebody please help me starting with Bennu?

Huge thanks in advance :D

darío

  • Sr. Member
  • ****
  • Mensajes: 458
  • Karma: 48
Re: I just can't get into Bennu :(
« Respuesta #1 en: Agosto 31, 2009, 02:43:25 pm »
Hi, yes, lack of tutorials is a problem to get started in Bennu but with some effort and help it is not impossible.

I've written this code for you (is a how-to-load-sprite-and-move-it), try to understand it and post your questions. Also search for functions used in Bennu wiki.

You need to create a "myball.png" file in the same folder than your bennu code.

Código: [Seleccionar]
// Bennu functions are grouped into different modules. With the import
// command you tell Bennu to load those modules.
import "mod_video"
import "mod_key"
import "mod_proc"
import "mod_map"

// Entry point of the application (main process)
begin
// Initialize the video mode to a 640x480 and 16bpp depth
set_mode(640, 480, 16);

// Call another process
MyBall();

// Loop that will repeat until we press the ESC key
repeat
frame; // Frame sentence tells bennu that we are done with
       // this process and that it should update the screen,
       // and let's other processes to execute
       // If you have an infinite loop without it, it will
       // seem as if the program is freezed.
until (key(_esc)) // key function returns true if a key is being
  // pressed

let_me_alone(); // destroys all processes except this
end

process MyBall()
begin
// Load an sprite from a PNG file
// The load_png loads a png file and returns a 'MAP identifier'.
// By assigning this identifier to the local variable 'graph' of
// a process, we are making the process to use this sprite as the
// 'sprite of the process'
graph = load_png("./myball.png");

// Set the position of the process. If you don't do this, you won't
// see anything.
x = 320;
y = 240;

// Loop of the process. It is necessary because otherwise
// the end of the process will be reached and it will be destroyed
// Herein we also do the Keys detection.
loop
// Use A, D, W, S to move the process
if (key(_a)) x--; end
if (key(_d)) x++; end
if (key(_w)) y--; end
if (key(_s)) y++; end

frame;
end
end

hope that helps.

Darío
My sites:
Smart Fpg Editor - Painless FPG Edition for Bennu and PixTudio
fenixlib - .NET support for manipulating PixTudio, Bennu and Div graphic formats

josebita

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re: I just can't get into Bennu :(
« Respuesta #2 en: Agosto 31, 2009, 03:31:42 pm »
There is a very recent tutorial made by Windgate @ http://bennu.ayudaprogramacion.net/, but it's in Spanish.

Most probably it will get translated into English at some point. In the meantime, you might be able to follow it will google translate.
We're working on the documentation, but it takes time, sorry for that :(

Anyway, feel free to ask for anything you don't understand.

Toxic_death

  • Newbie
  • *
  • Mensajes: 3
  • Karma: 0
Re: I just can't get into Bennu :(
« Respuesta #3 en: Agosto 31, 2009, 03:47:17 pm »
Awesome darío, thanks. That really helped. :)
But why do you have to execute the Myball process twice? At first, you declared it, and with "process Myball();" you started it or do you have to start it twice?

@ josebita:
No need to apologize, it's in my opinion better to translate the tutorial into a decent English instead of a quick and dirty translation, so I'll wait and maybe ask for some help if I get stuck :).

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: I just can't get into Bennu :(
« Respuesta #4 en: Agosto 31, 2009, 03:53:26 pm »
Translate it to English... I dind't count with it by now... And my english is a little bit odd...

Maybe with an automatic translation system you could be helped.

Anyway I will think about translate my tutorial when I finish my exams...

Toxic_death:

First you declare the process with PROCESS MyBall(), only one time.

Then you can "summon" the PROCESS with MyBall(); as many times as you want.
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

josebita

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re: I just can't get into Bennu :(
« Respuesta #5 en: Agosto 31, 2009, 03:54:52 pm »
@Windgate: I was kind of offering myself to do it, but later this month.

Toxic_death

  • Newbie
  • *
  • Mensajes: 3
  • Karma: 0
Re: I just can't get into Bennu :(
« Respuesta #6 en: Agosto 31, 2009, 04:18:35 pm »
Translate it to English... I dind't count with it by now... And my english is a little bit odd...

Maybe with an automatic translation system you could be helped.

Anyway I will think about translate my tutorial when I finish my exams...

Toxic_death:

First you declare the process with PROCESS MyBall(), only one time.

Then you can "summon" the PROCESS with MyBall(); as many times as you want.
Good luck for your exams. And thanks for clearing that process thing out :).
I think I'll give the google translation a try. :)

@Windgate: I was kind of offering myself to do it, but later this month.
The month's over tomorrow. ;) (Just kidding.)

osk

  • Hero Member
  • *****
  • Mensajes: 516
  • Karma: 52
Re: I just can't get into Bennu :(
« Respuesta #7 en: Agosto 31, 2009, 04:47:46 pm »
Bennu is a concurrent language. You define some code for "processes", but the only code that is executed from de beginning is the main program. And from this, if you call a specific process, then its code starts executing at the same time the code of main program is executing too. The frame command is the signal for all process to show on the screen the results of the execution of their particular code in a syncronized manner...all processes must have at least one frame command at the end of its main loop.

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: I just can't get into Bennu :(
« Respuesta #8 en: Agosto 31, 2009, 05:10:20 pm »
Citar
@Windgate: I was kind of offering myself to do it, but later this month.

Cool Josebita, send me a private msg whenever you are ready for action, I have to develop a Credits document for the tutorial, you will be there xD
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

josebita

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re: I just can't get into Bennu :(
« Respuesta #9 en: Agosto 31, 2009, 05:36:51 pm »
@Windgate: I was kind of offering myself to do it, but later this month.
The month's over tomorrow. ;) (Just kidding.)

XD Well, for me it's exams time, therefore it's september :)

darío

  • Sr. Member
  • ****
  • Mensajes: 458
  • Karma: 48
Re: I just can't get into Bennu :(
« Respuesta #10 en: Septiembre 01, 2009, 07:48:44 am »
Hehe, well sometimes it's also easy to help if you are specific with what you want :)
My sites:
Smart Fpg Editor - Painless FPG Edition for Bennu and PixTudio
fenixlib - .NET support for manipulating PixTudio, Bennu and Div graphic formats