Report a Bug

SIGN IN!

  • Impact ForumsLatest from the Impact Forums
  • Impact IRC ChatGet help from others on IRC
Visit Forums

Impact Forums

How to approach water with safe (sort of) moving platforms
Posted July 28, 2014, 1:20 pm — by BlondGorilla
Hi Guys

Building a game similar to frogger, looking for some advice on the best approach to deal with the water scenario.

The way Ive been dealing with water in general (ie the player dies if they jump into the water)... is to use one of the blank tiles on the collision layer (46) and in update check if they are on it then kill them...

If you remember the game screenshot here:
http://mytheongame.com/wp-content/uploads/2013/03/pFroggerPad.png

there are turtles and aligators floating in the water moving from side to side on the screen alligators kill the player (easy enough) and turtles carry the player to the edge of the screen.

Would a way to deal with this be to have an invisible entity that spawns turtle entities on the side of the screen, if the player moves onto a tile with a turtle, ignore the kill action then somehow link the player to the movement of the turtle entity.... (how would you do that)? any ideas would be awesome guys..

Cheers
Super Scrapped Robot
Posted July 28, 2014, 6:51 am — by Philip
The game doesn't really work on the iPhone prior iOS8. And we didn't optimize for that, so better grab the »native« Version form the app store: https://itunes.apple.com/app/super-scrapped-robot/id822321885

And thanks for the reporting on the unresponsive input, something went wrong with the last update, i'll have to look into that.

Edit: Looks like it has something to do with the iframe. If you right click into the game, the controls start to work. But i'll fix that.

Edit 2: And its fixed, thanks again for reporting that!
Dynamic Entity Positioning
Posted July 27, 2014, 2:00 pm — by hschillig
I have a trigger (exit into new level and then they can exit back out). So it's similar to Pokemon where you can enter a building and then leave it. However, when it goes back to the previous map, I want the entity to spawn right by the trigger (in this case, below it).

How would I go about doing that with an entity?

 
EntityGirl = ig.Entity.extend({
 
	animSheet: new ig.AnimationSheet( 'media/game2/player.png', 16, 16 ),
	size: {x: 16, y: 16},
	flip: false,
	friction: {x: 800, y: 800},
	accelGround: 300,
	accelAir: 150,
	health: 100,
	lastAction: 0,
	type: ig.Entity.TYPE.A,
 
	init: function( x, y, settings ) {
		this.parent( x, y, settings );
		this.addAnim( 'idle', 1, [0] );
		this.addAnim( 'run', 0.05, [0,1,2] );
		this.addAnim( 'runUp', 0.05, [6,7,8] );
		this.addAnim( 'runDown', 0.05, [3,4,5] );
		this.addAnim( 'upIdle', 1, [6]);
		this.addAnim( 'downIdle', 1, [3]);
	},
 
	update: function() {
 
		if( ig.input.state('left') ) {
			this.accel = {x: -this.accelGround, y: 0};
			this.flip = true;
			this.lastAction = 0;
		}
		else if( ig.input.state('right') ) {
			this.accel = {x: this.accelGround, y: 0};
			this.flip = false;
			this.lastAction = 0;
		}
		else if( ig.input.state('up') ) {
			this.accel = {x: 0, y: -this.accelAir};
			this.flip = false;
			this.lastAction = 'up';
		}
		else if( ig.input.state('down') ) {
			this.accel = {x: 0, y: this.accelAir};
			this.flip = false;
			this.lastAction = 'down';
		}
		else {
			this.accel = {x: 0, y: 0};
		}
 
		// set the current animation, based on the player's speed
		if( this.accel.x != 0 ) {
			this.currentAnim = this.anims.run;
		}
		else if( this.accel.y > 0 ) {
			this.currentAnim = this.anims.runDown;
		}
		else if( this.accel.y < 0 ) {
			this.currentAnim = this.anims.runUp;
		}
		else {
			if( this.lastAction == 'up' )
			{
				this.currentAnim = this.anims.upIdle;
			}
			else if( this.lastAction == 'down' )
			{
				this.currentAnim = this.anims.downIdle;
			}
			else
			{
				this.currentAnim = this.anims.idle;
			}
		}
 
		this.currentAnim.flip.x = this.flip;
 
		// move!
		this.parent();
	}
 
});
 

Older Posts

Ready to get to the point?

Your Email will remain private and is only used for good. We promise!


Please use only letters, numbers or underscores.

SIGN UP!