[Fenix] Can you explain the joystick to me?

Started by MisterN, August 23, 2011, 04:34:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SplinterGU

#15
Quote from: DoctorN on September 03, 2011, 08:49:21 PM
Ok, if you ever work on bennu, the #1 thing to work on is getting unload to work.

where are you from? I don't understand you... I thought I was the problem... but I speak daily with people who live in England and this people only speak English... and they understand me perfectly... and I understand them... but I can't understand you...

even google translator does not understand you ...

really sorry... I really wish understand you
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

josebita


MisterN

#17
Why do you have to be so rude sometimes? How old are you anyways?

And I do believe a bot is not capable of thinking a response.

I would like help with joysticks still (for fenix)
werg

SplinterGU

#18
we're not rude...

sometimes you're rude... some users have told me that was the reason why you had negative karmas.

I can't help you about Fenix... sorry...

I'm asking you serious, where are you from? English is your native language?
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

MisterN

Thats all you could have said but instead you gave me other stuff.
werg

SplinterGU

Please, no offense.
I alreay remove you all negative karmas (time ago).
I don't trying to offend you, only I can not help with Fenix.
Fenix ​​is too old and full of bugs.
And now I don't have time for port BennuGD to DC.


I don't know how DC Fenix works... DC don't works like normal Fenix... I think that DC Fenix use mapping joys -> keys... I don't know...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2


MisterN

Where does mel gibson come into all of this?

Anyways I have KOS and bennus code in there (its pretty straight foward like that), but it wont let me compile it. I tried compiling it for windows to see how itd work, but it wouldn't let me compile it.
werg

SplinterGU

image is "mel_gibson_furious_1_16c9v3n-16c9v41.jpg"

I think...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2


l1nk3rn3l

#25
i try compile bennu in dreamcast..  with this thing..
http://chui.dcemu.co.uk/sdl.html

i work in ps1 development, i think that is the same...

MisterN

ooooh PS1 Bennu? If I could get PS1 or PS2 thatll be another console ill consider making copies for. I have the special disc presser for those games.
werg

l1nk3rn3l

#27
not ps1 hardware sucks....


i will use this KIT to port bennu to dreamcast:  oh weellll ,  die trying..

http://www.megaupload.com/?d=7DJU09SD

MisterN

Quote from: l1nk3rn3l on September 05, 2011, 01:29:10 AM
oh weellll ,  die trying..

???

btw, you do not need the sega sdk hardware, all it is is essentially a dreamcast set up like a tower with a hard drive and a cable so you can stream what you are testing to the dreamcast easily. and dreamcasts can do that nowadays with the bba lol.
werg

Fuseki

Have you looked at the Primitive Nightmare source code? I have a good example of how to use the joystick functions in DC Fenix in that game.


Basically, I set up the controls as follows:



process controls();
begin
p1joy=select_joy(0);
stickx=get_joy_position(0);
sticky=get_joy_position(1);
padstart=get_joy_button(3);
pada=get_joy_button(2);
padb=get_joy_button(1);
padx=get_joy_button(6);
pady=get_joy_button(5);
end



You'll have to call controls() within your process loop:




process player()                   
begin
//blah blah blah- I snipped out any irrelevant code
loop
controls();
   if (stickx<0)
      x-=plspd;
   end
     
   if (stickx>0)
      x+=plspd;
   end
 
   if (sticky<0)
      y-=plspd;
   end
 
   if (sticky>0)
      y+=plspd;
   end
<snip>



The analog stick has values from -128 to 128. If the stick is pressed LEFT, you'll want to check if the value is LESS THAN 0. For RIGHT, GREATER than 0. Same for UP and DOWN. You can check the buttons by seeing if their state is pressed (state is 1) or not pressed (state is 0), but it's easier to just use the key() function instead of get_joy_button for those.


I also debounce the controls. What debouncing does is to make sure that only one key press is registered at a time, and adds a slight delay before you can make the next key press. The process then sets a flag (dbp, which is a global variable) to allow key presses again:




process debounce_ctrl();
private;
dbt;
begin
dbp=1;
dbt=10;
loop
   dbt--;
   if (dbt<=0)
      dbp=0;
      return;
   end
frame;
end
end



So then, in the controls checking part of your game loop, you'd add if (dbp==0) to allow key presses again.


NOTE:  this is for FENIX and not BENNU. I'm not sure how Bennu handles input as of yet.
Fuseki Games
Classic- style games for the Dreamcast
http://www.fusekigames.com
----------------
Dreamcast Fenix Resource Page
http://atari.vg-network.com