Jump to content

  • Log In with Google      Sign In   
  • Create Account


rubsnick

Member Since 14 Aug 2010
Offline Last Active Sep 03 2013 08:58 AM
-----

Topics I've Started

How can I get my character to come back down even if the user still has the button pres...

10 December 2012 - 02:47 PM

I sort of cheated in my Physics Department I want to make my Code Efficient. I don't want it to do any complex physica algorithms since I"m developing the game for a Cell Phone and want it to work on the weakest ones avalible. So thus I cheated on my physics. When you press the jump button he jumps and he has a limit of 50pixels. He won't go past 50 pixels. Which is great so no matter how long the button is pressed he won't go past his boundry. The main problem I'm having is even after the button is pressed he will simply just float. He reaches the limit but only floats. I want my character to act like sonic. The longer the press the higher he goes but once he reachers his peak I want him to fall back down. I just don't know how to bring him down. I tried to check if he was at 50px subtract it until 0 but it only does it once before he goes back up (thanks to the game loop). So I don't really know how to time the input out or what would the best course of action be.

I"m using Libgdx and I can't seem to get the android Project to run?

06 August 2012 - 04:42 PM

So I follow this tutorial get everything set up and working and follow it to the letter. Test the desktop version and it works. Everything is just peachy and fine. I then try out the android version of it. Bam it won't start instantly force closes. I decided to start again from scratch maybe I missed something something didn't work. This time I just skip and try to compile the default project. Lo Behold it works display the default thing in both places. I think awesome to myself, so I code what I need to code just show a simple .png with some looping music. Compile it on Desktop it works. Great I think to myself nice now lets try android. I try the android version and it won't work. I tried via emulator and via my phone. No dice. Nothing it just shows me the default project that was compiled. So I think to myself WTF? I deleted the compiled .apk and try to run it again. Same thing happends.

I'm truly at a loss at to what I need to be doing. Here is the link to the tutorial

http://code.google.c.../wiki/SimpleApp

I'm using Eclipse Juno with the latest version of libgdx and I tried every single target version messing with the androind manifest and using various androind emulators with different OS versions. So I'm truly at a loss as to what i"m going to do or what the hell the problem might be.

EDIT: I discovered the problem is. Any Texture must be in the power of two. so instead of 48 I used 64x64 and everything worked just fine.

Need some help with my Code here, I want to add functionalities to the buttons on the b...

01 April 2012 - 04:53 PM

This is my code so far....http://pastebin.com/LxmSuMe8

Posted Image






I have the mouse pointer working so far and all that jazz... Basically I want to click on the buttons and the balls up there to create the shapes. I already have an idea of how the algorithms work but I just want to know how to make the buttons work. :/ My code isn't commented yet but I"m going to do it soon and update it for your guys ease but it's pretty straight forward... I know it's ugly but sorry guys.... anyway tips would be wonderful

Trying to do ball to ball collicions.... and it's not working.

15 February 2012 - 07:27 AM

I've made the paddle and everything and it works but when they touch it they don't recognize one another so I tried to implement this collision but it doesn't seem to work properly. I"m assuming I might need more variables but I"m not entirely sure. :/ I know the code might be a bit messy I"ve been taking from everywhere to learn this. So any tips?

This chunk controls the overall movement of the balls

public partial class Game1
    {
	    public void Ball1mover()
	    {
		    if (movingUp)
		    {
			    ball1Position.Y -= 3;
		    }
		    else
		    {
			    ball1Position.Y += 3;
		    }
		    if (movingLeft)
		    {
			    ball1Position.X -= 3;
		    }
		    else
		    {
			    ball1Position.X += 3;
		    }
		    if (ball1Position.X <= 0 && movingLeft) movingLeft = false;
		    if (ball1Position.Y <= 0 && movingUp) movingUp = false;
		    if (ball1Position.X >= (graphics.GraphicsDevice.Viewport.Width - ball1.Width) && !movingLeft) movingLeft = true;
		    if (DetectPaddleBallCollision())
		    {
			    movingUp = true;
		    }
		    if (DetectPaddleBallCollision())
		    {
			    movingUp = true;
		    }
	    }
	    public void Ball2mover()
	    {
		    if (movingUp2)
		    {
			    ball2Position.Y -= 3;
		    }
		    else
		    {
			    ball2Position.Y += 3;
		    }
		    if (movingLeft2)
		    {
			    ball2Position.X -= 3;
		    }
		    else
		    {
			    ball2Position.X += 3;
		    }
		    if (ball2Position.X <= 0 && movingLeft2) movingLeft2 = false;
		    if (ball2Position.Y <= 0 && movingUp2) movingUp2 = false;
		    if (ball2Position.X >= (graphics.GraphicsDevice.Viewport.Width - ball1.Width) && !movingLeft2) movingLeft2 = true;
		    if (DetectPaddleBallCollision2())
		    {
			    movingUp2 = true;
		    }
	    }

This code works I just think it'll help with the understanding the movement. The detectPaddleBallcollision methods return true or false of the boolean Movingup and moving left.

So I tried to do somethign that came to mind which is this

public void BalltoBallCollision()
	    {
		    //Controlls ball 1 movement
		    {
			    if (ball1Position.Y == ball2Position.Y )
			    movingUp = false;
			    if (ball1Position.X == ball2Position.X)
			    movingLeft = false;}
		    if (ball1Position.Y == ball2Position.Y )
			    movingUp2 = true;
		    if (ball1Position.X == ball2Position.X)
			    movingLeft2 = true;
	    }

When I implement that the balls do collide but I have a problem with the paddle, it'll somehow control both of them... so I"m not entirely sure how to "fix" it... I'm thinking of adding several other boolean variable so they don't interfear with the general movement. But I don't know how I would implement them.

Anyway So any idea on what I could do here? If need be I"ll uplaod the entire project if it'll make things easier.

My professor is looking for the source code for one of two games.

08 February 2012 - 11:29 AM

#1.A game called "Survival", there are a lot of bubbles coming from above floating down and you're a ship of some sorts shooting at these bubbles. The bubbles collide with one another, and tada! They change their vector direction.

#2. A game called "Stargate", you're a ship it's similar to the last one but these blocks are falling from above. You pretty much just have to shoot these blocks falling from above.

I'm not entirely sure how these games work or how to make them but I I can't find them I need to make them. So any code in C++ would be greatly appreciated.... He said these games where from the 1980's arcades and should have free source code there. But I'm not quite sure if these games even existed. So yeah I'm just trying to figure out what to do or how to do it.

PARTNERS