9 Replies - 3474 Views - Last Post: 04 November 2008 - 05:38 PM Rate Topic: -----

#1 Sonastylol  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 151
  • Joined: 15-December 07

Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 03:39 PM

Is it possible to create a web based game that doesn't just display a picture of an enemy or something and have text with things you are doing?

I have a similar topic in the Javascript board, but I was told a game I asked about in that topic was NOT made in javascript, but with what looks to be ASP.

I want to have a map with buildings on the map that are clickable links to shops. I also want to show ALL online characters on the map, and when you move with a directional button, your character moves and will refresh the map (moving everyone else as well).

Is this possible in PHP?

I don't want to make "ANOTHER" mafia-based text game.

Is This A Good Question/Topic? 0
  • +

Replies To: Web-Based Game with Maps and Moving avatars?

#2 Sonastylol  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 151
  • Joined: 15-December 07

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 03:44 PM

Quote

Yes, it's possible - you may need to throw in some Javascript for some of your map interactions, but all of the database-released workings of the game would be done in a server-side language like PHP, ASP, Perl, etc.

Was This Post Helpful? 0
  • +
  • -

#3 Moonbat  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 36
  • View blog
  • Posts: 424
  • Joined: 30-June 08

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 03:47 PM

You'll need to learn about imagemaps with Javascript to make an in-game map with clickable links. Here's a good resource:

http://www.w3schools..._image_maps.asp

As far as making actual moving characters, I'm not sure you can do that with PHP. You might just have to make a Flash game or something.
Was This Post Helpful? 0
  • +
  • -

#4 Sonastylol  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 151
  • Joined: 15-December 07

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 03:53 PM

Not moving in real time, loading positions onto the image map.

Sorry if you misunderstood.

And its certainly possible, I played this game from age 11-14 ^_^.

Here is an image of it to clarify!

http://img148.images...ge=game2ty6.jpg

I will check out the image map link. Thanks.

**EDIT**

Moonbat, it is most definitely image maps! Now I just need to figure out two things:

1) [This one is simple] How to implement something like that to bring a building on the image map to a page where you can buy something, then return you back to the map

2) Implement a way to get peoples characters to load on that image map. From the looks of it, image maps are created by giving the individual images coordinates. I need to some how design a way for everyone who is on a certain map (lets call it beach 1) to have their character's coords from the database loaded and displayed on this imagemap. So in the user table you would have map [beach1], x [50], y [50], then do a search for all characters on the current map (beach 1) to get displayed on the screen.

Seems EXTREMELY difficult. I'm almost positive this is NOT the way to go about doing this.

This post has been edited by Sonastylol: 04 November 2008 - 04:16 PM

Was This Post Helpful? 0
  • +
  • -

#5 Moonbat  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 36
  • View blog
  • Posts: 424
  • Joined: 30-June 08

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 04:11 PM

Hmm... Here's what I thought of. Please keep in mind I just thought of this right now, so it might not be the best idea.

The players are in a database. The database, in addition to holding normal player data, will hold the player's last coordnates before they logged off. When the player logs back in, the coords will load from the DB. Every time the player moves, the new movement coords will be stored in a session variable. The session variable will keep changing as the user moves, and then when the user logs off the last value of the session variable holding the coordinates will be stored in the database. Let me just draft a quick chart here to illustrate that process.

Player moves -> Session variable holds movement -> Player logs off -> Session variable is put in database -> Player logs in -> Coordinates are taken from database and loaded into session variable -> Rinse and repeat
Was This Post Helpful? 0
  • +
  • -

#6 Sonastylol  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 151
  • Joined: 15-December 07

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 04:16 PM

That sounds good, just need to be able to show the character's physical data on the imagemap as well, which is not something I am sure how to do.

Also, I edited my post and asked above 2 questions, then edited a new question in there.

That new question is no longer needed, because you dont put new images ON TOP of an image, you put those shops IN the map image, and the hotspots that are drawn are for determining what areas are clickable for a certain link. I just did it right now in dreamweaver and it works great.

What I'm thinking is, instead of http://www.google.com or anything in the LINK section of a hotspot on the imagemap, you can instead have http://www.sitename....e=#&variable2=#

etc etc, to manipulate the game RIGHT in that one page.

Oh yes, I am getting somewhere with this now. This is getting interesting.
Was This Post Helpful? 0
  • +
  • -

#7 Moonbat  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 36
  • View blog
  • Posts: 424
  • Joined: 30-June 08

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 04:27 PM

If you have the coordinates right in the URL, people could edit them to move like halfway across the map :P
Was This Post Helpful? 0
  • +
  • -

#8 Sonastylol  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 151
  • Joined: 15-December 07

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 04:37 PM

Moonbat and anyone interested in this topic, check this out.

Just spent 10 mins getting some ideas together.


http://www.progressi...m/game/test.php

Seems to be moving to the right path. I don't think showing actual characters on the map is important, but what about enemies? That IS important, which means if enemies can be spawned onto the map, so can characters.


What do you think I should do about spawning enemies on this map?

(this is currently not tied to a database or anything)

**EDIT**

in this example here, you can have text change before the click, meaning I can make the click bring you to the shop without needing to have that extra echo of where you are once you are there.

It may be best to do the map with javascript then.

http://www.w3schools...=tryjs_imagemap

This post has been edited by Sonastylol: 04 November 2008 - 05:22 PM

Was This Post Helpful? 0
  • +
  • -

#9 Moonbat  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 36
  • View blog
  • Posts: 424
  • Joined: 30-June 08

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 05:22 PM

Do you want enemies to randomly spawn? You can just use rand() to make a simple algorithm to determine if an enemy should spawn or not.

As far as showing the enemies, I'm not sure how you would do that.

In your test game, you should make it so that if someone changes the 'loc' variable to a nonexistant area (like 4023 or something) it should give an error.
Was This Post Helpful? 0
  • +
  • -

#10 Sonastylol  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 151
  • Joined: 15-December 07

Re: Web-Based Game with Maps and Moving avatars?

Posted 04 November 2008 - 05:38 PM

View PostMoonbat, on 4 Nov, 2008 - 04:22 PM, said:

Do you want enemies to randomly spawn? You can just use rand() to make a simple algorithm to determine if an enemy should spawn or not.

As far as showing the enemies, I'm not sure how you would do that.

In your test game, you should make it so that if someone changes the 'loc' variable to a nonexistant area (like 4023 or something) it should give an error.


You are absolutely right, I will make it so that the user cannot tamper with the game outside of the control he/she is supposed to have.
I won't even use "loc", and this won't be the map I use at all. Just wanted to show you my progress -- a visual example of my thought-process, if you will...


And yes, this seems to be the issue I am having trouble grasping thru normal English. What I wanted was for characters and enemies to show on the screen to make the game feel real without being a 3D MMORPG, then with the map refreshing every 10 seconds or so have enemies spawn on the map as clickable enemies. When clicked, the player who hit the enemy will go into combat with him,, and he will disappear on everyone else's map. Im thinking this would have to be done through a monster database which has enemies get created and displayed through the database with a status = 0 field, when in combat status = 1, then when dead or out of combat (victoriously killing player), status = 0.

This seems like it HAS to be done through javascript or something.

God.. I wish I knew more about javascript so I could achieve this.

=/ Please set me on the right path, because the image map path is definitely correct, just need to piece the rest of this together.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1