Kuru Kuru Kuririn Clone


another update..
thouht ill do the maps with hardness maps..
so i used this code..
if (key(_left))
IF (map_get_pixel(0,7,(x-3),y<>22))
x=x-3;
END
looked in my pal and i use the color which is on 22 for the map.. stil it doesnt work :(
 
Don`t know anything about the map_get_pixel command, but would like to hear any info about it, didn`t really look through the tuts using it yet.
 
ok just on ")" was wrong works now..
but .. what comes? next problem..
it stops the stick in the center and not if another part of the stick touches the border.. so i have to rotate the stick in another way.. may have to use sprites i think...

EDIT:

ok tried to use this control points in a picture.. but the get pixel command just works with one of those.. think i have to use the collision command
or does has someone a better idea?
 
Hmmm good point. Let's imagine we have the stick like this:

<-----o-----> "o" is control point #0 and this sample stick is 13 pixels long.

We could use several map_get_pixel to get more precision in the collision detection routine we're gonna build up:

x--x--x--x--x "x" will be the parts of the stick that can detect a collision with the hardness map. We have 5 of those.

In the final game you should use precalculated trigonometric values, but until you get to that point, the routine you need would look like this:

Code:
pix1=map_get_pixel(0,7,x+6*sine(angle),y+6*cos(angle));
pix2=map_get_pixel(0,7,x+5*sine(angle),y+5*cos(angle));
//...
pix5=map_get_pixel(0,7,x+2*sine(angle),y+2*cos(angle));

if(pix1==[collision color here]);
//Collision code here
end
if(pix2==//Etc.

It's the only solution I can come up with. Using the regular collision detection function would be too time consuming I think.
 
BIG THANKS!!! but
uff.. thats code..
i hate sin and cos also in school :)
hmm.. so
those pix1 ... are Private variables.
you have to help me a bit more with this.. sry..

this is my movement code until yet... not much i know.. ( in the moment i work on ripping sprites and backgrounds)
Code:
PROCESS ctrlstick(x,y);
BEGIN
ctype=c_scroll;   // He'll scroll with the background
scroll.camera=id; // The camera will focus on him during the scroll
graph=3;
loop
	angle+=1600;
  if (key(_left))
  	IF (map_get_pixel(0,7,(x-3),y)<>22) 
    x=x-3; 
  	END
  end
  if (key(_right))
    IF (map_get_pixel(0,7,(x+3),y)<>22)
    	x=x+3; 
    end
   end
   if (key(_up)) 
    IF (map_get_pixel(0,7,x,(y-3))<>22) 
    y=y-3; 
    end
   end
   if (key(_down))
    IF (map_get_pixel(0,7,x,(y+3))<>22) 
    y=y+3; 
    end
   end
	frame; 
	end;
end;

things i want to change..
i write the same command in every movment line.. want to change this (it was just for now to test).. i also have to change this because i want to do Health points, exit etc also with map_get_pixel...
 
would this also work with something like if(collision (type get_map_pixel...)), I know I`m making up commands :D, but does something like this exist?
Would be easier than to make all the sinus&cosinus stuff.
 
hehe i thought about the same yesterday in bed ;)
would be nice if this would be possible in a way ..
 
Sonic-NKT posted on Apr 13 2005 at 03:55 PM said:
hehe i thought about the same yesterday in bed ;)
would be nice if this would be possible in a way ..

Lol no thinking about programming in bed!

The thing you two invented won't work xD

And you completely have to change the structure above. The main loop would look like this:

Code:
loop;
 angle+=1600;
 
 if (key(_left)) //On the key detection, you just need the movement code
   x=x-3; 
 end
 if (key(_right))
   x=x+3; 
 end
 if (key(_up)) 
   y=y-3; 
 end
 if (key(_down))
    y=y+3; 
 end

  //Collision code (still has to be written xD) goes here
  
  //and now, if a collision is detected
  x=previous_x;
  y=previous_y;

  frame;

  previous_x=x;
  previous_y=y;

end;

I'd love having kurukurukururin on my gp32 (hm I still have to test it on gpadvance xD -semijoking) so I'll try making up a collision system if you dont come up with a better one.
 
Last edited by a moderator:
it would be nice if a more advanced fenix coder would help ;)
and i tried it on gpadvance already.. it didnt run :(
if you get me a working collision system i could port (remake/clone) some maps.. and rip some more important textures

PS: never really programmed before... so i have a basic question.
i want to make also an intro for the gp32 version.. i fun version of the original. so how to make it.. every character, background etc an own process ? or is there another way..
anyway
thanks!

EDIT:
how would you code a process for a sprite which shows up and goes away after some time again and then shows up again.. on and on..
is there a special function for this in fenix?
i did it this way:
Code:
PROCESS START();
PRIVATE
BEGIN
x=160;
y=195;
graph=9;
loop
        z=30;
        while (z=>-30)
        z=z-1;
        frame;
        end;
end
end
it works.. so i just asl if i could do it better..
 
Oh, the code is perfect, really :p I'm gonna play the original game again so that I can get an idea of how to make this work and I'll tell you.
 
ok...
you know the health platforms and the Exit platforms right?
those should be done with map_get_pixel too i think
but since the are animated it has to be an own process right?
 
Yup. The hardness maps thing is very easy to use. And yes, you'd need to use additional processes for the platforms, but that's no big deal.

Can you send me some graphics? The stick image would be enough for now (just to start writing the collision code).
 
hmm cant do that in the moment sorry.. i have problems with my pc, cant login in xp anymore.. very strange.. perhaps tomorrow or so.
it was 80x7 or so i think.. dont know exactly...
is it bad if you make your own for now and i give you the right one later this weekend?
 
lol yeah, 4 at the same time. I won't finish any of them, I so lazy. But this time I only have to write a collision code that seems quite simple, I think I can make it (unless someone else does it before me lol). School's getting a bit stressing this last term with all the final exams so I don't know how am I gonna get time for everything.
 
working on menu gets boring :)
and ive allready finished some maps (hope i can use them later)
PS
would it be ok for you when i enter this the GBAX coding competition 2005.. or together.
 
Back
Top