26 lines
368 B
C
26 lines
368 B
C
#include <camera.h>
|
|
#include <mario.h>
|
|
#include <world.h>
|
|
#include <base.h>
|
|
|
|
static int y=0;
|
|
|
|
int camera_x() {return min(max(mario.p.x-40,0),w_current_x*8-128);}
|
|
int camera_y() {return y;}
|
|
|
|
void camera_move(unsigned int delay)
|
|
{
|
|
if (!delay)
|
|
delay=3; // on ajoute 1/3
|
|
y+=(mario.p.y-y)/delay;
|
|
}
|
|
|
|
void camera_adjust()
|
|
{
|
|
y=mario.p.y;
|
|
}
|
|
|
|
void camera_reset()
|
|
{
|
|
y=0;
|
|
} |