Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 14th Sep 2003 00:49
Hey there, i want to design a game where you can attack monsters using a character model.
Like if you click Shift, then the character will attack with his sword.
And the enemie's life will go down 1
Can anyone give me a source code idea that i could use.
I will be more than greatful to help me out.
The reason is because I'm still learning DBP - i have got far with a little help using Tutorial's and the Manual book, but have no idea how to do this.

Thanks
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Sep 2003 00:57 Edited at: 14th Sep 2003 01:00
Doubt you'll have much luck there matey. I suggest you study the manuals a bit more, and try a few things yourself.


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 14th Sep 2003 01:09
Well yer i would love to, but will i find out everything i need if i study better?
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 14th Sep 2003 01:23 Edited at: 14th Sep 2003 01:24
Maybe, maybe not - the more you practise the better you get and you'll think up better routines...
However, you need to practise and learn, and it might take a while.


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 14th Sep 2003 02:19
Here is roughly speaking, what you need to do.

When the shift key is pressed (detect using SHIFTKEY() ), move the sword forwards (using POSITION OBJECT, if your character has an attacking animation, use PLAY ANIMATION as well). Use OBJECT COLLISION to detect the sword hitting the enemy, if they hit, decrement the lives counter.

This is a rough sketch in semi-pseudo code
Note that "Sword","Enemy" are just numbers

If Shiftkey()
Move Object Sword,1
If Object Collision (Sword,Enemy)
Dec EnemyLives
Endif
Move Object Sword,-1
Endif

zircher
23
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 14th Sep 2003 02:20 Edited at: 14th Sep 2003 02:28
Andrew, you don't need code. You need a design first. You should have in your head (and preferably on paper) a complete idea of how you want the combat logic to work. This is a lot like designing a role playing game. Once you know how the numbers work out, you can then start writing code to store data and create functions to handle attacking, receiving damage, etc.

DBC/DBP does not have any game code like 'attack enemy' or 'inflict damage with sword'. You have to write all that for yourself.

BTW, are you working on an RPG [Final Fantasy, Knights of the Old Republic], a wargame [Warcraft, C&C], or a fight simulator [Blade of Darkness, assorted martial arts games]? Each combat model will handle the numbers and user input differently.
--
TAZ

Rob K's example is for fight simulations where you control every aspect of your character's motion and determine in real time if there is a intersection of sword and enemy objects. The code example is really just the tip of the iceberg. Did the sword hit a shield, armor, a wall? Does the enemy take half damage from bladed weapons? What is the time delay in between strikes? Will a wounded enemy have a harder time returning an attack? Is morale an issue or do all enemies fight to the death? The design of a combat system is no small task.
UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 14th Sep 2003 02:36 Edited at: 14th Sep 2003 02:38
have you made a space invaders clone yet??
No ome should try to tackle a project which is anything like an
rpg b4 they have made one. By then you will have realised that a
projuct like the one you are trying to do is at least 3 years away.

the artist formally known as darkfluff

Login to post a reply

Server time is: 2026-07-24 00:18:48
Your offset time is: 2026-07-24 00:18:48