fight system

Place to place any code snippets, completed games, or even uncompleted games for IR users to use.
Post Reply
SyllkiT
Posts: 3
Joined: Fri Jul 05, 2013 10:52 am

fight system

Post by SyllkiT »

Hello can someone put Fighting script where player can fight with other player to hallsofvallhalla mmorpg browser based game (http://www.youtube.com/watch?v=0YqFFu5d ... D8EF52C1D2)
User avatar
vitinho444
Posts: 2825
Joined: Mon Mar 21, 2011 4:54 pm

Re: fight system

Post by vitinho444 »

I haven't watched all his tutorials about it, but doesn't he cover that ?
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
SyllkiT
Posts: 3
Joined: Fri Jul 05, 2013 10:52 am

Re: fight system

Post by SyllkiT »

vitinho444 wrote:I haven't watched all his tutorials about it, but doesn't he cover that ?
No there is a battle system with creatures !
User avatar
vitinho444
Posts: 2825
Joined: Mon Mar 21, 2011 4:54 pm

Re: fight system

Post by vitinho444 »

SyllkiT wrote:
vitinho444 wrote:I haven't watched all his tutorials about it, but doesn't he cover that ?
No there is a battle system with creatures !
Hum, I can't think of anything but you trying to upgrade it to PvP :/ I think you should worry on SP first just saying.

Sorry i can't help you :S
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Callan S.
Posts: 2043
Joined: Sun Jan 24, 2010 5:43 am

Re: fight system

Post by Callan S. »

Not sure what's being asked for, but I set this up awhile ago to complete the monster combat, if you've watched the tutorial videos from 1 to 5.

http://indie-resource.com/forums/viewto ... =26&t=1353
User avatar
vitinho444
Posts: 2825
Joined: Mon Mar 21, 2011 4:54 pm

Re: fight system

Post by vitinho444 »

Callan S. wrote:Not sure what's being asked for, but I set this up awhile ago to complete the monster combat, if you've watched the tutorial videos from 1 to 5.

http://indie-resource.com/forums/viewto ... =26&t=1353
I think he wants a PvP system.
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
SyllkiT
Posts: 3
Joined: Fri Jul 05, 2013 10:52 am

Re: fight system

Post by SyllkiT »

vitinho444 wrote:
Callan S. wrote:Not sure what's being asked for, but I set this up awhile ago to complete the monster combat, if you've watched the tutorial videos from 1 to 5.

http://indie-resource.com/forums/viewto ... =26&t=1353
I think he wants a PvP system.
Yes i want a PvP system ( i am noob in english )
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: fight system

Post by Jackolantern »

SyllkiT wrote:
vitinho444 wrote:
Callan S. wrote:Not sure what's being asked for, but I set this up awhile ago to complete the monster combat, if you've watched the tutorial videos from 1 to 5.

http://indie-resource.com/forums/viewto ... =26&t=1353
I think he wants a PvP system.
Yes i want a PvP system ( i am noob in english )
PvP is difficult to pull off with PHP alone, since PHP is server-side, meaning everything has to be known at the time the request comes in to the server so it can create the HTML to send to the user. The problem with PvP in PHP is that if you try to attack another player, there is no way to notify them that they were attacked. PHP offers no way to reach back out to users once the page has loaded.

The two options are to integrate a PvP system in Javascript, which is outside the scope of the original MMO browser tutorials, or, the more common PHP PvP solution, is to create kind of a "PvP by mail" system where players trade hits over time. In a system like that, a player logs in, and checks their PvP battles. They trade a hit back to all the people who hit them while they were logged out. That is probably not the kind of PvP you want, though, which would mean Javascript would be required. I think Halls' next browser MMO tutorial series (coming sometime soon) is going to have more Javascript.
The indelible lord of tl;dr
User avatar
Callan S.
Posts: 2043
Joined: Sun Jan 24, 2010 5:43 am

Re: fight system

Post by Callan S. »

vitinho444 wrote:I think he wants a PvP system.
Oops, I missread! :oops:

On PVP, I think using the refresh command you could have timed turns, which would ensure the page both refreshes and the other player must act within X amount of time.
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: fight system

Post by Jackolantern »

Callan S. wrote:
vitinho444 wrote:I think he wants a PvP system.
Oops, I missread! :oops:

On PVP, I think using the refresh command you could have timed turns, which would ensure the page both refreshes and the other player must act within X amount of time.
That would still require a little bit of Javascript to timer the refresh, right? Nothing that you couldn't find on Google...or, right below this sentence:

Code: Select all

<script>
setInterval(function() {
      document.location.reload(true);     //reloads the page...
}, 4000);   //...every 4 seconds
</script>
But that poses a problem. How do you notify someone that they are being attacked? Putting this script on every page all the time would be impractical since it would cripple other game functions to constantly have the page refreshing. The simplest solution would be to use a little AJAX polling to check the db every so often to see if an attack has been made on the player.
The indelible lord of tl;dr
Post Reply

Return to “Code Sharing”