Re: newbie in game developing

so, friends, i have been reviving this topic after so many days with a new question
so, i have reached to make maps, enimys, i made enimys and player fight, and it's quite working awesome
but, what i am doing is, there is no base map for player and enimy. im just comparing enimy position and player position to make hits, atack etc.
what is the best way to keep track of characters like enimys, player and ojects like walls, items etc. and what's the best way to manage surfaces etc in a base map? i couldn't figure out a clean logic for this.
of course i keep telling my logics that i figured out. but, this time, i figured out more non clean logic
my logic is to make a class for map and keep track of all items in one list, with there x and y position. and of course, i will specify there position in there specific class.
i make them in to one list
and, i make all the surfaces in to one list so that i can do loop though them and check
for example, if i
for s in surfaces:
    if player.x in range(s.start_x, s.start_y):
        #then play appropriate sound for that tile
and, for items i wan't to do like this
for i in items:
    if i.x == player.x:
        player.inventory.give(random.choice(supplys), random.randint(1, 5)) #here i am giving random item in my collection of supplys that i am giving to my player and random amount between 1 to 5
so, is this the best way to do so?
and if i do, where i write these functjions. if i do this in map functions, then, i see no use with map class because normally without map class we can have these but some more painfull than these.
here, i see no use with map class. sorry if my asumtion is  wrong. can you tell a best way to do this with a map class?

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Turret via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to