Discuss Game level Objects in the Game Development forum on Dev Shed. Game level Objects Game Development forum covering non language specific programming - game creation, design, modding, theories and math. A place for developers and gamers of all levels to discuss and debate all things involved in game creation and modding.
Posts: 5,573
Time spent in forums: 1 Month 11 h 9 m 33 sec
Reputation Power: 406
Game level Objects
If you was to create a game that requires alot of objects specially on a certain level.. how would you create the objects? Would you define them in a class ( i.e level_ 1 = "objects1, objects2... etc ) or would you randomly select them? See the thing is that im coding an arkanoid clone.. a very basic one for now, untill I can advance knowledge wise in creating games.
Posts: 4,845
Time spent in forums: 1 Month 1 Day 20 h 15 m 58 sec
Reputation Power: 634
I think it'd depend on the game, if the game always has to look the same then you always have them the same, if it can be random then select them random each time.
Posts: 264
Time spent in forums: 6 Days 2 h 28 m 19 sec
Reputation Power: 123
What do you mean by objects?
In that particular game you would probably consider each block to be some sort of entity, which when broken may release some sort of power-up randomly. For that I would make the blocks a class, and have a member function called "destroy()" which chooses whether or not to spawn a power-up entity which could then be added to some sort of global entity list for tracking.
On the other hand, games like first person shooters or RPG's may require specific objects to be at specific locations all the time. In that case normally the map data will include a list of such entities, specifying what type they are, the location, and any applied attributes. This could also be used for the construction of the blocks in your game.
On a completely different topic, there is a similar game called "Jarindains!" that's pretty fun.
Posts: 1,585
Time spent in forums: 2 Weeks 4 Days 2 h 58 m 23 sec
Reputation Power: 1372
The usual solution is to have a datafile that contains information about the objects in the level. Your code reads in the datafile and creates the objects.
For an arkanoyd type game the format could be very simple - a text file with one line per block, containing color, x-pos, y-pos, powerup (if any). More complex games could need a structured format such as XML.
Making the level data a text file means you can get up and running quickly by hand editing it. Later you can write a level editor that lets you design the level visually and saves out the level data into a file ready to be read in by the game code.
Posts: 5,573
Time spent in forums: 1 Month 11 h 9 m 33 sec
Reputation Power: 406
Ya.. so far I have the objects done.. and all right along with posX, and posY.. I was wondering.. since Im fairly new at this game creation... Anyone Im going to zip up what I have so far for my game.. maybe I can get some comments on it before I can continue... Also note that It will not have the bar on it yet.. it will just be the block objects.. and a red window on your right hand side.. but.. the ball is currently making all the actions . But I would actually love some comment on it though..
Posts: 5,573
Time spent in forums: 1 Month 11 h 9 m 33 sec
Reputation Power: 406
Ya.. hehe Im actually getting an error on installing pythong distutils, Going over to post it at the python forum just hold on tight till I can get this working.. this way if you dont have pygame installed you wont need it.
Posts: 5,573
Time spent in forums: 1 Month 11 h 9 m 33 sec
Reputation Power: 406
Well Ok what ever, Im going to have to read on how to use distutils.. Dont have time for that right now. but anways.. Remeber the game is not done yet... Im still missing some objects.. this is just for testing and comments
Requirements: SDL, Python, Pygame, SDL-Mixer, Usualy most of these are already installed in your system, Also sorry guys.. but this is a Linux only for now :S, but I think it should also be ran on windows.
Last edited by xlordt : July 3rd, 2006 at 09:26 PM.
Posts: 5,654
Time spent in forums: 2 Months 2 Weeks 2 Days 5 h 1 m 44 sec
Reputation Power: 3436
Well, I loaded it up on my box at home over vnc. Looked alright. The ball bounce isn't very natural. Looks like you just flip both the x/y direction when it hits a block. I don't know any pythong (or python either ) so looking at the source would be a bit pointless for me.