Using sprites.png for sprite . fpg in game

Started by pdiddles03, May 19, 2011, 03:57:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pdiddles03

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?

BlackCurtain

#1
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.

pdiddles03

I dont wana seem ignorant or anything, but How am i supposed to actually use that code? 

BlackCurtain

#3
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.

l1nk3rn3l

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...

pdiddles03

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.

Drumpi

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.
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)