Jump to content
MakeWebGames

Maps


peterisgb

Recommended Posts

I don't really post here much, not as much as i should.

This is a mod i have been working on, with some help for a while now, it could be better and would love to see what users do with it.

Please do post back feedback and your updates. :D.

This is a Map system, you can travel around the map, attack other players, find stuff, go to towns, buy a house within a town, upgrade your house, do missions and plans for more.

Here goes,

move.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

movetown1.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

And of course the php stuff

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Also you need to create 6 new fields into the users

locationx int 11 default 0

locationy int 11 default 0

moves int 11 default 50 (or whatever else you choose, you'll need to insert this into the cron line.).

maxmoves int(11) 50

locationxt int(11) 10

locationyt int(11) 10

and i think at last but not least, the images, sorry the images ain't good but i'm not very good and pics.

At least this is one idea thats never been done before.

mapimageback.zip

  • Like 1
Link to comment
Share on other sites

  • <font> is deprecated
  • Why inline styling? Use classes/ids and make the free system more adaptable to your audience
  • Why so many $locationx and $locationy if() statements? Use array logic for this!
  • Constants defined in the middle of the script - ew.
  • Functions that echo HTML... ew.
  • Staff actions have no real indenting - it's hard to read.
  • Staff actions are vulnerable to SQL injection.
  • Hardcoded cost values... ew.
  • Where's the classes? The extendibility? The awesome?!

 

Though, great attempt but please read and consider the above - if you need any assistance with of the points, Slack me.

Edited by ~Rob0t
Link to comment
Share on other sites

I don't really post here much, not as much as i should.

This is a mod i have been working on, with some help for a while now, it could be better and would love to see what users do with it.

Please do post back feedback and your updates. :D.

This is a Map system, you can travel around the map, attack other players, find stuff, go to towns, buy a house within a town, upgrade your house, do missions and plans for more.

Here goes,

move.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

movetown1.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And of course the php stuff

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Also you need to create 3 new fields into the users

locationx int 11 default 0

locationy int 11 default 0

moves int 11 default 50 (or whatever else you choose, you'll need to insert this into the cron line.).

and i think at last but not least, the images, sorry the images ain't good but i'm not very good and pics.

At least this is one idea thats never been done before.

Ewwww, so many unnecessary if statements, and it's hardcoded in some areas and you ain't even escaping your queries or sanitizing your POSTS but nice attempt

  • Like 1
Link to comment
Share on other sites

guys bug off with this lol.

This thread is about my rubbish code with great ideas and potential,

All comments about my map system please.

Also if any of you have used this please post your updates here and i want this to be a communal project.

Edited by peterisgb
  • Like 1
Link to comment
Share on other sites

Ewwww, so many unnecessary if statements, and it's hardcoded in some areas and you ain't even escaping your queries or sanitizing your POSTS but nice attempt

 

So, let me get this right - everybody elses crappy comments get deleted, but the biggest cawk comment on here remains?

Yeah, I get that....

Link to comment
Share on other sites

In my defense I didn't feel it was that bad of a post. Could it have been better? Yes. But he did say there is a better approach to having so many if()s although he didn't say what was better. And I just thought it was sort of constructive but it was on topic for the most part. I did realize I went crazy and deleted [MENTION=68961]Veramis[/MENTION] post and that was my fault, it did contribute so I will fix that.

Link to comment
Share on other sites

I love you [MENTION=50378]Guest[/MENTION].

You must spread some Reputation around before giving it to Guest again.

Peter you should think about optimizing the database stuff. You don't need everything to be int 11

Optimizing the database stuff, explain, alot has changed since i left.

 

Ewwww, so many unnecessary if statements, and it's hardcoded in some areas and you ain't even escaping your queries or sanitizing your POSTS but nice attempt

ty for the nice attempt, so with the unnecessary if statements, what should of do instead?

 

  • <font> is deprecated
  • Why inline styling? Use classes/ids and make the free system more adaptable to your audience
  • Why so many $locationx and $locationy if() statements? Use array logic for this!
  • Constants defined in the middle of the script - ew.
  • Functions that echo HTML... ew.
  • Staff actions have no real indenting - it's hard to read.
  • Staff actions are vulnerable to SQL injection.
  • Hardcoded cost values... ew.
  • Where's the classes? The extendibility? The awesome?!

 

Though, great attempt but please read and consider the above

What do you mean by inline styling?

I don't know how to properly do array logic, it confuses me and i get stuck,

What do you mean constant defined in the middle of the script.

functions that echo HTML, how else do i print something? print "?

Yeah the staff options was abit rushed, That was the last thing i was working on before posting it up,

Protection against staff SQL injections lol, ouch yeah i know, I've never quite got the hang of how to "secure stuff" reason why i don't run a game, just make crap lol.

"Where's the classes? The extendibility? The awesome?!" explain, what awsome? the map is awsome and you can move around it and go into town and buy a house lol.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 2 months later...
  • 4 years later...

The idea is great, it can be used on a JRPG game

I might use the idea on my fantasy-RPG game, I got already 2D assets for castels, houses, decoration and materials

just need to finish all the project i got on hand 🤣

I might try it today after i finish a module im working on

 

Edited by ags_cs4
Link to comment
Share on other sites

6 hours ago, ags_cs4 said:

The idea is great, it can be used on a JRPG game

I might use the idea on my fantasy-RPG game, I got already 2D assets for castels, houses, decoration and materials

just need to finish all the project i got on hand 🤣

I might try it today after i finish a module im working on

 

This was before i really learnt arrays, Still not great arrays but had i know how to do arrays this wouldnt be half as long as it is.
I'd suggest to array most of this before working on it.

Link to comment
Share on other sites

1 hour ago, ags_cs4 said:

yeah that goes without saying, plus lot of optimization on the db side, will need to read the code more to see what need to be remade but so far its a gread idea tbh how did i miss this gem 🤣

hehe, After i got this far it didnt quite fit into the game i was running at the time so i posted it here instead of just binning it as it was too much of a good idea just to throw it away, specially after all the work put into it.

Link to comment
Share on other sites

@peterisgb i like the idea 

i did work on a system for a map with locations/cities (circles) and quests (scrolls), chests 

the game need lot of thinking than any normal browser game as i want the game to have long duration on travel not just like 1h-5h maybe like days, and want the game to be like story driven than the usual pvp or pve games out there

image.png.70c6b02e8caf22144f4b6e9225ab2cc0.png

Edited by ags_cs4
Link to comment
Share on other sites

9 minutes ago, ags_cs4 said:

@peterisgb i like the idea 

i did work on a system for a map with locations/cities (circles) and quests (scrolls), chests 

the game need lot of thinking than any normal browser game as i want the game to have long duration on travel not just like 1h-5h maybe like days, and want the game to be like story driven than the usual pvp or pve games out there

image.png.70c6b02e8caf22144f4b6e9225ab2cc0.png

That map.... Tbh that map looks way better and makes mine look like dog s**t lol

Link to comment
Share on other sites

37 minutes ago, peterisgb said:

That map.... Tbh that map looks way better and makes mine look like dog s**t lol

lol but yours you can travel move and stuff, mine is just showing you locations all can be changed to text based with nothing new 😄 

Link to comment
Share on other sites

couldnt read the code 🤣

 might be better to start fresh then work on old code 😄 

but the idea that allow you to walk the map and see the other player is great

will be tricky to make the maps responsive without zooming and de-zooming (grafic will look bad)

Link to comment
Share on other sites

53 minutes ago, ags_cs4 said:

couldnt read the code 🤣

 might be better to start fresh then work on old code 😄 

but the idea that allow you to walk the map and see the other player is great

will be tricky to make the maps responsive without zooming and de-zooming (grafic will look bad)

yeah, it is quite a code. Not my longest at all but pretty long 😄
My biggest mod is still in production but its upto 2300 lines and still going 😄

Link to comment
Share on other sites

  • 2 weeks later...

Ok, Well. So I don't have this on my game, this being made LONG ago and i can't be bother to optimize, So I've decided to use AI to sort it.
I didn't know the bot could read pastebin!!!. This is what the bot said and now it got it to sort it haha.

If you're concerned about the character limit for posting your code here, you can try breaking it down into smaller chunks and sharing them one by one. Alternatively, you can use online code-sharing platforms like GitHub Gist or Pastebin to share your code and provide the link here. That way, you can share the entire code without worrying about any character limits.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...