adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] More on maps & input!


From: Alexandre Courbot
Subject: [Adonthell-devel] More on maps & input!
Date: 24 Feb 2002 20:50:11 +0100

Oki, today was sunday, so I wanted to have a bit of fun. So I've ripped
and zoomed 2x one of the C**ono Tr***er characters (I'm lame!) and use
it on to test the map characters movments. The system needed a bit of
tuning, but now it's working perfectly.

Get http://www.gnurou.org/adonthell-stuff/alextest.tgz and unpack it
from your adonthell src/ directory. Then update your CVS copy, and build
and run alextest. As before, you can move with arrow keys, and run by
pressing 'r', excepted that this time it starts looking like something,
and it uses the new input system! :)

The different kinds of movements are achieved using the map_placeable
'state' system. Each movment corresponds to a map character state. For
standing, walking and running the names of the states are hard-coded, of
course. They are coded by the letter of the direction (n,s,w or e),
followed by a '_' and the name of the movment: stand, walk or run.
Examples: n_stand, w_run. This scheme is designed for efficiency - so
please do not ask to change it ;) 

States changing is automatically handled by the map_character class from
the velocity and the running status, so you don't have to worry about
them for simple usage. More interesting is that you can worry with them,
if you want. You can add your own custom states and trigger them. For
example, I've added a "say_hi" state which use a custom gfx and is
triggered when you press the 'h' key. As you can see, we now have much
more freedom than before with characters, and the same applies to map
objects (and could apply to items, and everything that is displayed on
the map, too!)

The program will also listen to mouse input. It will print every mouse
event that occurs. It even handles the wheel! :p

Just got Jol at phone. His GUI is coming along well too. Looks like I'll
be able to start some editors! :) He'll probably request some theme gfxs
for buttons and others GUI elements. We're going one step further on the
GUI side too, you see! ;)

About the input system now: it supports both keyboard and mouse events,
and is designed to be as much independant as possible from SDL (only
input_manager.cc depends on SDL). I'll finish/tune/document it from now.
What's missing is joystick support, and of course the mappable control
events. After that, we'll be able to perform controls just the way James
proposed - we'll all have to get a SNES pad and plug it on our parallel
port then! ;)

Have fun!
Alex.
-- 
http://www.gnurou.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]