Update (10/10/09):We are now on release 4. What has been done thus far:
Menu has been added, it is now possible to select from multiple levels.
Finish Area has been implemented in the game and editor. When you cross the finish line you will be taken to the Level Select screen.
Marble movement has been sped up, you should notice a big difference in the speed of acceleration. If not I can modify that variable.
Level Editor has been changed to include corner pieces. I have not packaged the Level Editor in an executable, I've had problems coming up with an easy solution to find your saved levels because the application gets installed in a very weird location.
Please disregard the options screen, I will work on it next go-around. Just a few requests, if anyone could get me a 64x64 png for the icon that would be awesome. Also, if anyone wants to submit a level they have made just email it to me. griffin_ellis@hotmail.com
Instructions on using the Level Creator, and how to import the levels into the game:
Run the Teeter Editor by opening it in Visual Studio.
The left and right arrow keys will switch between objects. Press R to rotate a non-corner piece. Click to place an object.
Once you are done with your level, press "F1" to save. You can name the level whatever you would like but you DONT have to add ".xml" to the end. For example, my first level would be "Level1"
You can also load levels by pressing "F2" and typing in the level name.
Now open up the "TeeterBeta" project in Visual Studio. Right click "Content", then "Add", "Existing Item". You will now need to navigate to your TeeterEditor directory, then bin/x86/Debug/ and select the level you would like to import. Now right click the xml file on the "Content" directory and click properties. Set "Build Action" to None, "Content Processor" to No Processing Required, and "Copy to Output Directory" to Copy if Newer. Next step:
Open up LevelSelectScreen.cs under the Screens folder in Solution Explorer. Follow the example for the first two levels and specify the correct level name.
This should be easier than before, but if anyone is still having problems I will not hesitate to make a video guide, because it's actually a lot simpler than it sounds.
Last edited by Twanks; 10-10-2009 at 01:59 PM.
Reason: Release 4
So just wondering, I haven't actually looked at it too much but can't you use the same style of collision detection you use to stop the ball going off screen to stop it going through the walls?
Development Front Retired Staff Professional Spammer
Join Date: Jan 2007
Location: Look up
Posts: 8,377
I haven't tested this as I don't have an HD nor do I have the hd xna libraries, so one of you will have to test this. But anyways, replace the current wall collision in game1.cs (it's in its own region) with the code below. Should work, but likelihood of a typo is high. I know rectangle has interesect, but how it intersects matters adn I didn't see a library method to return what side it collided on, so I just did it manually. This should work as long as the velocity<thickness of the wall. It also won't handle corners well, but that's just a matter of
for corner
__get corner pos
__if corner pos' distance to the center of the ball is less than the radius of the ball
____do bouncing calc
and adding to the code below a padding distance of the ball's radius onto the outer if statements
Code:
foreach(Wall wall in walls)
{
if (wall.wallRect.Top <= ball.ballRect.Top && wall.wallRect.Bottom >= ball.ballRect.Bottom)
{
if (wall.wallRect.Right > ball.ballRect.Left)
{
ball.Position.X -= ball.Velocity.X;
}
else if (wall.wallRect.Left < ball.ballRect.Right)
{
ball.Position.X -= ball.Velocity.X;
}
}
if (wall.wallRect.Left <= ball.ballRect.Left && wall.wallRect.Right >= ball.ballRect.Right)
{
if (wall.wallRect.Bottom > ball.ballRect.Top)
{
ball.Position.Y -= ball.Velocity.Y;
}
else if (wall.wallRect.Top < ball.ballRect.Bottom)
{
ball.Position.Y -= ball.Velocity.Y;
}
}
}
@ God: Replacing it with that code unfortunately makes it spaz out a bit, it appears to be colliding on nothing, and by passing straight through walls whilst jerking around. It also likes to move the total opposite direction to the way its being tilted after a while o.O
I made some graphics for this game a week back, im sure he hasn't put em in yet. The ball also needs to go a lot faster.
Here http://cid-d50ae2a7439417a3.skydrive...e.aspx/.Public
I have animated png's of the ball, if anyone figures out how to animate them, i'll post.
Last edited by Katman1245; 10-07-2009 at 02:03 PM.
Is the level Creator supposed to show up on the Zune, Because when I press "T" Nothing happens and I have never seen it on the Zune before, but then again I haven't seen much
Johnny: That was my original thought, but without going into too much detail, it's a disastrous idea once you think about the implementation.
I have a variable (at least I think I do) to modify the max velocity of the ball. Also, Thursday morning I don't have class because my first class starts at 2 PM Central Time, so I will try to work on this. The collision detection with boundaries has been a major pain, but I'm confident we will get it worked out.
Hey if anyone gets a good version done, tell me so i can add the most amazing graphics for it that match the zune style, i'd post but i rather keep them untill i finish, they are looking real nice though. Also i will post the game when i add graphics. So when you update please tell me and give me source to add graphics of awesomeness.
Just to ask, why do you limit the velocity in the following block of code?:
Code:
//Clamp Ball velocity from -3 to 3 for both components of the vector
if (ball.Velocity.X < -1.5)
ball.Velocity.X = -1.5f;
if (ball.Velocity.X > 1.5f)
ball.Velocity.X = 1.5f;
if (ball.Velocity.Y < -1.5f)
ball.Velocity.Y = -1.5f;
if (ball.Velocity.Y > 1.5f)
ball.Velocity.Y = 1.5f;
The thing making the ball move is "gravity" affecting the ball when the field is tilted, so technically the ball should constantly accelerate and the velocity should never stop increasing when tilted. I commented out that section of the code and the ball seemed to move much more realistically so unless you have the code for another reason I'd take it out.
i havent looked at the game yet or the code, so if im wrong ignore me, but the most likely reason for the ball passing through walls is that you are either moving multiple units at a time, or are not checking collision frequently enough, if you move the ball based on timer speed IE/ moving 1 unit every half second is the same speed as moving 2 units every second, or if you increase the frquency of your collision check, the problem may go away, i had a similar problem on a space lander game i made a few months ago, Gl
Just for anyone wondering what I did for collision, before adding the velocity to the ball's position, I "look in the future" and see if it will collide, not if it is colliding. This seems to work much easier, and should perform better.
Yes, I know, sorry. I am going to be gone for a few hours but I wanted to at least have something out. As soon as I get back I will be working on this some more, so I have that to fix and start/finish to add. Then I will start working on a menu system, most likely derived off of the Game State Management sample.
You now have a way to win. I forgot to mention in my top post, I'm going to have to implement a scrolling option for the level select screen. I will do that soon enough. Anyone reading, please leave your comments on playability/etc.
It's greatly improved. I like this. However the walls still look funky. The graphics I gave you are built so that on the horizontal walls, you need to rotate the png 90 degrees. The one edge piece should be put on ends, and If i get time on sunday, I will create a 90 deg corner for you. Can't wait for the levels.