Bennu Game Development

English Forums => General => Topic started by: pdiddles03 on May 19, 2011, 03:57:34 PM

Title: Using sprites.png for sprite . fpg in game
Post by: pdiddles03 on May 19, 2011, 03:57:34 PM
so I have a quick question, well a few.

since there is not very many guides how how to do some things.  How do you put a sprite on screen and animate the sprite map when you push left, right or up or down?

Also, If i planned on making a space shooter, what is the code used to give enemies artificial intelligence?
Title: Re: Using sprites.png for sprite . fpg in game
Post by: BlackCurtain on May 19, 2011, 09:21:41 PM
For you first question: [code language="bennu"]if(key(_left)) graph++; frame; end[/code]

For your second question: When it comes to AI, there's not simply a single working code. AI can be how complex or simple you want. It depends on what you want the AI to do. So I don't think I can answer that for you. I suggest you study some books on how to design AI.
Title: Re: Using sprites.png for sprite . fpg in game
Post by: pdiddles03 on May 20, 2011, 12:19:12 PM
I dont wana seem ignorant or anything, but How am i supposed to actually use that code? 
Title: Re: Using sprites.png for sprite . fpg in game
Post by: BlackCurtain on May 20, 2011, 12:31:06 PM
Quote from: pdiddles03 on May 20, 2011, 12:19:12 PM
I dont wana seem ignorant or anything, but How am i supposed to actually use that code?  

Do you know how BennuGD works at all?

Btw, this is the wrong forum to be asking about this. Should be in Helpdesk.
Title: Re: Using sprites.png for sprite . fpg in game
Post by: l1nk3rn3l on May 20, 2011, 12:58:04 PM
Quote from: pdiddles03 on May 19, 2011, 03:57:34 PM

Also, If i planned on making a space shooter, what is the code used to give enemies artificial intelligence?


download bennupack examples....   games with AI included...
Title: Re: Using sprites.png for sprite . fpg in game
Post by: pdiddles03 on May 21, 2011, 08:28:02 PM
I ask about this because as I look at the guides, I have a hard time understanding them because everything is usually in another language.
Title: Re: Using sprites.png for sprite . fpg in game
Post by: Drumpi on July 02, 2011, 12:20:21 PM
IF you use PNG files instead an FPG, I recomend to store their returned values into an array, so you only need to change array index every frame in your process to assign it to GRAPH variable.
An animation its only a graphic change, so you must do it in a loop/while/repeat. If it goes too fast, you must use a counter to make a delay (wait until it reach a value you choose before change GRAPH).

About direction, you can use 4 arrays, or a bidimensional array, so you only need another variable who says what direction are you going and select a graphic set you need.

And for AI, there are tons of books aout this, so there isn't any code we could give to you.
The best way to do it is to have a process for everi kind of ship, and another process who control every squadron (squadron = a bundle of ships following a path on screen). There are some examples, in bennupack, and i did another game on Screen Break Time, but i don't remember if code is in english or in spanish.