Autor Tema: Using sprites.png for sprite . fpg in game  (Leído 2491 veces)

pdiddles03

  • Newbie
  • *
  • Mensajes: 23
  • Karma: 0
Using sprites.png for sprite . fpg in game
« en: Mayo 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?

BlackCurtain

  • Full Member
  • ***
  • Mensajes: 187
  • Karma: 9
    • Black Curtain Studio
Re: Using sprites.png for sprite . fpg in game
« Respuesta #1 en: Mayo 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.
« última modificación: Mayo 19, 2011, 09:25:00 pm por BlackCurtain »

pdiddles03

  • Newbie
  • *
  • Mensajes: 23
  • Karma: 0
Re: Using sprites.png for sprite . fpg in game
« Respuesta #2 en: Mayo 20, 2011, 12:19:12 pm »
I dont wana seem ignorant or anything, but How am i supposed to actually use that code? 

BlackCurtain

  • Full Member
  • ***
  • Mensajes: 187
  • Karma: 9
    • Black Curtain Studio
Re: Using sprites.png for sprite . fpg in game
« Respuesta #3 en: Mayo 20, 2011, 12:31:06 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.
« última modificación: Mayo 20, 2011, 12:51:06 pm por BlackCurtain »

l1nk3rn3l

  • Hero Member
  • *****
  • Mensajes: 2014
  • Karma: 257
Re: Using sprites.png for sprite . fpg in game
« Respuesta #4 en: Mayo 20, 2011, 12:58:04 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

  • Newbie
  • *
  • Mensajes: 23
  • Karma: 0
Re: Using sprites.png for sprite . fpg in game
« Respuesta #5 en: Mayo 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.

Drumpi

  • Hero Member
  • *****
  • Mensajes: 6466
  • Karma: 168
  • Odio el periodo "entre proyectos"
    • La web de Drumpi
Re: Using sprites.png for sprite . fpg in game
« Respuesta #6 en: Julio 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.
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)