Jump to content

  • Log In with Google      Sign In   
  • Create Account

Scorpie

Member Since 05 Apr 2006
Offline Last Active Today, 09:42 AM

Posts I've Made

In Topic: a better fix your timestep?

23 January 2015 - 10:24 AM


I like to build hard core simulations. the type of thing where the delays of network lag are unacceptable, and "prediction" is the most evil thing in the world ever. So on the rare occasions when i do networked games, they're lock stepped to maintain perfect sync. I've gone so far as to write my own protocalls so robust you could unplug the phone line, plug it back in, and not lose sync. but in the end, you can only "ACK" so may "ACKs", and then you have to take it on faith the last one got through.

 

It's funny that you mention things like simulation where delays, prediction (by which i assume inaccuracies) are unacceptable. Yet you propose and defend a solution in which you present the user with views (renders) where the objects shown reside(? correct word ?) at a different point in time.

These arguments you use against the f-y-t actually prove your own theory as unacceptable for your purpose, and probably most other. (notice the italic part, it may have uses as Hodgman suggests).


In Topic: Function that takes unknown amount of strings, how do i vector?

04 June 2014 - 05:37 AM

 

 

Possible i don't have latest c++11?

I'm guessing you're using Visual Studio. VS <2013 doesn't have initializer lists.

 

I am out dated blink.png...  99$ for 2013 upgrade, too broke ATM for that.

I will make do with horrible syntax.

 

 

You can get the Visual Studio 2013 Expess edition for free if it fits your needs. You only have to register your email after 30 days to continue free usage for unlimited period.


In Topic: Enemy only shoots once. Help

19 October 2012 - 10:44 AM

Ah, it seems like there are quite some issues with the [ source ] tags, i always type [ code ] which seems to work fine, maybe a bit less fancy but it get's the job done :)

Good to hear that you fixed the problems!

In Topic: 2D driving physics woes (problems) 2D Vector Math questions

19 October 2012 - 10:37 AM

Not sure if this fixes it but it looks like you are passing your angles in degrees and in physics.c you apply radians to degree instead you should be using degree to radians (angle / 180.0 * PI)

In Topic: Enemy only shoots once. Help

18 October 2012 - 04:34 AM

First of all, i notice that you use a lot of " = " operators in your if-statements (line 69, 120, 127), this is wrong and should be replaced with the compare operator " == " like you use in other places (line 36, 44). Check the rest of your code for this mistake also because when you use it here, chances are you use it in other places too.

I don't have time to check everything in your code at the moment (@work) but there might be some more problems, for example comment in lines 67,68 state:
//if the enemy dies remove it
//Need to delete the current one and make a new enemy
There is no enemy deletion going on there so i have no idea why it is there

Anyways, for your shooting problem:
the scope of the while-loop in this code is wrong:
if(health = p1.x)
	    {
		    while(readyToFire)
		    {
			    shot = true;
			    readyToFire = false;
			    bullet = new Rectangle (enemy.x+45, enemy.y+65);
			    by = enemy.y+65;
			    bx = enemy.x+45;
			    bullet = new Rectangle(bx, by, 3 , 15);
			    System.out.println("Hi");
			
		    if(bullet.y >= 595)
		    {
			    bullet = new Rectangle(0, 0, 0, 0);
			    shot = false;
			    readyToFire = true;
				
		    }
	    }
	    }

You need to move the if-statement outside the while in order for it to be checked (after all, you set readyToFire to false inside the while)
Change it to:
if(health == p1.x)
	    {
		    while(readyToFire)
		    {
			    shot = true;
			    readyToFire = false;
			    bullet = new Rectangle (enemy.x+45, enemy.y+65);
			    by = enemy.y+65;
			    bx = enemy.x+45;
			    bullet = new Rectangle(bx, by, 3 , 15);
			    System.out.println("Hi");
			 }
		    if(bullet.y >= 595)
		    {
			    bullet = new Rectangle(0, 0, 0, 0);
			    shot = false;
			    readyToFire = true;
				
		    }
	    }

ps. i changed the " = " to " == " in that code but i have no idea what is going on there so you might need to move the pieces around some more there are some weird things going on in your code (why are you comparing health with the x coordinate of the player??? )

PARTNERS