sync on
sync rate 100
hide mouse
`make health
health=100
`store object positions
x=camera position x(0)
y=camera position y(0)
z=camera position z(0)
make object sphere 1,50
color object 1, RGB(0,244,0)
`make 3 enemies
make object cube 3, 20
make object cube 4, 20
make object cube 5, 20
`make enemy position
make object sphere 6, 5
make object sphere 7, 5
make object sphere 8, 5
`enemy location & speed
ene1=rnd(300)+100
ene2=rnd(200)+100
ene3=rnd(200)+50
speed=rnd(2.5)+1
position object 6, ene1,0, ene2
position object 7, ene2,0, ene3
position object 8, ene3,0, ene1
`ene1
en1x=object position x(6)
en1z=object position z(6)
en2x=object position x(7)
en2z=object position z(7)
en3x=object position x(8)
en3z=object position z(8)
hide object 1
hide object 6
hide object 7
hide object 8
do
x=camera position x(0)
y=camera position y(0)
z=camera position z(0)
point object 6,x,y,z
point object 7,x,y,z
point object 8,x,y,z
print "Frames Per Second: ", screen fps()
print "YOUR HEALTH IS: ", health
position object 1,x,y,z
move object 6, 1.2
move object 7, 0.7
move object 8, 1.5
turn object left 3, 10
turn object left 4, 10
turn object left 5, 10
position object 4, object position x(6), 0, object position z(6)
position object 5, object position x(7), 0, object position z(7)
position object 3, object position x(8), 0, object position z(8)
position object 1, camera position x(0), camera position y(0), camera position z(0)
control camera using arrowkeys 0,2,2
sync
loop
That's the code for my game so far. It's going to use a height map later on and an object for a wall around the heightmap. I need some good tutorials for ai. I just need simple ai for the enemies but i want allies too. I also want some commands for it
[i]I want
A. a unit selection program
selects the closest ally/allies with the commands "follow me", "move out", and "Attack" (attack-attacks the closest enemy while staying in a certain radius of your unit)
B. ally/enemy attacking units
1. enemy attacks the closest unit unless that unit is already under attack by a unit other than an archer.
2.archers knowing who to attack, running away from my their team's units if too close, knowing how far to throw the arrow
3.grouping together to prevent over-spreading
C. other stuff
1.how to do cow or chicken ai(for scenery)
2.burning system
I know that most of those arevery complex and i wont get most of the answers. Btw i may be posting in the newcomer's corner but im still good at programming since my dad knows basic and has been teaching me.
look, a signature!
made you look---------dancing penguins rule... you dont