PDA

View Full Version : turn based game // multiple movement instances



nitras
June 18th, 2006, 05:53 PM
Hi gang

i am trying out to expand my flash skills by (i hope) building a rather simple game
well i guess; if anyone knows "memoire 44" it's a classic boardgame, it's based on this.
it's actually a very ez game to play, but translating it to code is offcourse something different.

i've made a hex grid with each an unique id,
now for the basic movement that's pretty simple

but here we go :)

i want multiple instances for the movement

lemme explain
it's kinda a war game so hence my naming
i've colored the questions in orange

ive managed to find a way to first select the unit and then choose a new position

now
a ground unit, can move up to 2 hexes MAX but can't fight that turn
or it can move 1 hex and still fight that turn.
(when a unit gets into water, it has to wait thus can't fight this turn, when the requested distance was 2 hexes from the point of origin, it stops when hitting the water) (not done yet)
if you test the swf you'll see you can move up to 2 hexes, but somethimes you can move further. how do i code this solid? additional info: it seems it works fine only in the positive direction thus from left to right.

i know i have to check the distance between the point of origin minus the selected distance but i get lost in the code for now. (hence it's my first game tryout ever)
hoping i don't put the stakes too high.

once i get this fixed i can make other units on this standard but first things first.
but i am stuck


i've searched whole weeked and came back with nill!

hopefully someone can assist me
if the game ever gets done i'll put credit where credit is due.

PS. if you test; you only can move to the lowest row for now (again first things first)

kind regards & thanks in advance.
you'll need the laco tween engine in order to see the tweens

the files:
http://www.nitras.be/memoire_spinoff/memoire_test.html
http://www.nitras.be/memoire_spinoff/memoire_test.fla (http://www.nitras.be/memoire_spinoff/memoire_test.fla)

Joppe
June 18th, 2006, 06:02 PM
Uhm, I seem to not understand your question, mind reforumlating?

nitras
June 18th, 2006, 06:23 PM
Uhm, I seem to not understand your question, mind reforumlating?
sure, my english isn't that good

it's like i said based on memoire 44 : a turn based board game:
http://www.memoir44.com/

lemme explain:

in the board game you'll get "command cards" for example:
"move 3 units in the left area"

(still have to divide the grid in 3 areas : left , center , right) as seen here
http://static.memoir44.com/lang/english/images/mm_board-country.jpg

so in this case you'll have to assign 3 units and place them into a new direction(or not, it's not a demand, aka you can choose to stay ground)

soldiers can move 2 hexes and not fight, or 1 hex and still fight
tanks can move 3 hexes and still fight or 4 and not fight
artillery can shoot up to 6 hexes

fighting for soldiers is : shooting range of 2 hexes max.
fighting for tanks is : shooting range of 4 hexes max.

when these 3 units are selected and have fought your turn is over and the next player does his commands.

so the question is.
______
i am looking for a way to say that a single unit(only when selected in this case the soldier mc.)
can move up to 1 hex in any direction and still be able to fight (fight engine will be : like stated above).


or if you choose to move 2 hexes(maximum for the soldier mc) it can't fight anymore. and so the the next unit must be selected in order to finish your turn

so to clear things up even more with a bit of pseudocode

if unit selected & moved 2 hexes : this unit.enabled = false
if unit selected & movedd 1 hex : this unit.fight = true;
if unit selected is moved out of range (max 2) trace "you can't go there"
_______

the rules are pretty ez but a bit harder to code :)

i hope this was a bit more better to understand.

Joppe
June 18th, 2006, 07:03 PM
ah yeah thanks for clearing that out

I dont have that tween file so i cant test out some stuff, maybe you could attach it?

nitras
June 19th, 2006, 01:49 AM
ah yeah thanks for clearing that out

I dont have that tween file so i cant test out some stuff, maybe you could attach it?

http://laco.wz.cz/tween/

it's called customEasing tool

you'll need to install it

thanx in advance joppe