Jump to content


pixelpig

Member Since 26 Jul 2008
Offline Last Active Apr 19 2012 08:54 PM

Topics I've Started

The best way to colide with generated terrain...

12 February 2011 - 12:57 AM

Okay, so I have a randomly generated terrain which has the levels at each point stored in terrain.level[x-coord]. I also have a tank. The tank should sit on the ground in a manner so that it is rotated correctly. I think I am on the right track with the code I have now, it sits on the terrain and rotates but the terrain can sometimes go up into the tank if you cross over a hill due to this code taking in only two points and often looks rather jumpy and does not have an accurate gravitational effect on the sides of the tank. I have considered putting in some kind of vertical speed for each side but I thought I might as well try and get it to actually sit correctly first.

My code follows(Sorry about the format):
posx1=x+lengthdir_x(
    point_distance(0,0,-sprite_get_xoffset(sprite_index),sprite_height-sprite_get_yoffset(sprite_index)),
    image_angle+point_direction(0,0,-sprite_get_xoffset(sprite_index),sprite_height-sprite_get_yoffset(sprite_index)));
posy1=y+lengthdir_y(
    point_distance(0,0,-sprite_get_xoffset(sprite_index),sprite_height-sprite_get_yoffset(sprite_index)),
    image_angle+point_direction(0,0,-sprite_get_xoffset(sprite_index),sprite_height-sprite_get_yoffset(sprite_index)));
posx2=x+lengthdir_x(
    point_distance(0,0,-sprite_get_xoffset(sprite_index)+sprite_width,sprite_height-sprite_get_yoffset(sprite_index)),
    image_angle+point_direction(0,0,-sprite_get_xoffset(sprite_index)+sprite_width,sprite_height-sprite_get_yoffset(sprite_index)));
posy2=y+lengthdir_y(
    point_distance(0,0,-sprite_get_xoffset(sprite_index)+sprite_width,sprite_height-sprite_get_yoffset(sprite_index)),
    image_angle+point_direction(0,0,-sprite_get_xoffset(sprite_index)+sprite_width,sprite_height-sprite_get_yoffset(sprite_index)));

while((room_height-terrain.level[posx1] < posy1) || (room_height-terrain.level[posx2] < posy2)) {
if((room_height-terrain.level[posx1] < posy1)) {
    image_angle-=1;
}
if((room_height-terrain.level[posx2] < posy2)) {
    image_angle+=1;
}
if((room_height-terrain.level[posx1] < posy1) ||(room_height-terrain.level[posx2] < posy2)) {
        y-=1;
        vspeed=0;
        gravity=0;
}
posx1=x+lengthdir_x(
    point_distance(0,0,-sprite_get_xoffset(sprite_index),sprite_height-sprite_get_yoffset(sprite_index)),
    image_angle+point_direction(0,0,-sprite_get_xoffset(sprite_index),sprite_height-sprite_get_yoffset(sprite_index)));
posy1=y+lengthdir_y(
    point_distance(0,0,-sprite_get_xoffset(sprite_index),sprite_height-sprite_get_yoffset(sprite_index)),
    image_angle+point_direction(0,0,-sprite_get_xoffset(sprite_index),sprite_height-sprite_get_yoffset(sprite_index)));
posx2=x+lengthdir_x(
    point_distance(0,0,-sprite_get_xoffset(sprite_index)+sprite_width,sprite_height-sprite_get_yoffset(sprite_index)),
    image_angle+point_direction(0,0,-sprite_get_xoffset(sprite_index)+sprite_width,sprite_height-sprite_get_yoffset(sprite_index)));
posy2=y+lengthdir_y(
    point_distance(0,0,-sprite_get_xoffset(sprite_index)+sprite_width,sprite_height-sprite_get_yoffset(sprite_index)),
    image_angle+point_direction(0,0,-sprite_get_xoffset(sprite_index)+sprite_width,sprite_height-sprite_get_yoffset(sprite_index)));

}
if((room_height-terrain.level[posx1] > posy1) ||(room_height-terrain.level[posx2] > posy2)) {
    gravity=1;
}

Various Side On Sprites Required

14 April 2010 - 02:17 AM

Hello,
As you are reading this I take it that you are a keen spriter who would be happy to sprite for my game.
I have a lot of different types of images to be fulfilled.
The game is in GM7, So no alpha please.
The style should be cartoon like.
I will be needing:

People Sprites
Subtypes:
  • Standing
  • Walking
  • Running
  • Animated death(Falling over)
  • Dead
  • Crushed
All of the sprites of people must all be recolour able. Clothing does not matter, although I would prefer to have one of each subtype for each person.
Flaming versions would also be helpful.
Please do not include heads.

I will also need sprites of heads. These should be an animation of the head growing and getting redder, followed by an explosion.

The whole image put together (With the normal unexpanded head) should be no more than 64 pixels high and 32 pixels wide.
Vehicle Sprites
The vehicle sprites should be of:
  • Helicopters
  • Aeroplanes
  • Civilian Cars
  • Any Military Vehicle
All of these vehicles should suit the size of a normal person.
You may or may not include pilots in these vehicles.
Building Sprites
I don't really mind much about this one, skyscrapers, houses, offices, anything. Make it suitable to the size of the other sprites.
Please also make a destruction(collapsing) animation.

Thank you for reading, and creating sprites in advance.

Platform Bot Example *fix For Jump Height*

04 April 2010 - 09:30 PM

  • Title: Platform Bot Example
  • Description: Platform bot that walks randomly and can jump to platforms. It includes code to get the vspeed required to jump a certain height(although this is innacurate due to problems in calculating it)
  • GM Version: 8
  • Registered: no
  • File Type: .gmk
  • File Size: 0.01mb
  • File Link: Download
Additional Info
No credit is required.

If anyone wants anything added, just ask.

A fix has been made to the jump height. The download link is of the fixed version.

Script Doesn't Work

24 March 2010 - 08:54 PM

Please help.
Code:
var dslist,str;
str=argument0;
if(argument1) {
//code encryption here
}
if(!tcpconnected(CON)) {
	CON=tcpconnect("****",80,0);
}
if(!tcpconnected(CON)) {
	return -1;
}
clearbuffer();
writechars("GET /minis/lbi/game/?"+str+" HTTP/1.1"+chr(13)+chr(10));
writechars("Host: ****"+chr(13)+chr(10));
writechars("User-Agent: LBi/0.7"+chr(13)+chr(10)+chr(13)+chr(10));
sendmessage(CON);
writebyte(0);
setpos(0);
show_message(readstring());
setformat(CON, 1, chr(13) + chr(10));
loop=true;
while(loop) {
	receivemessage(CON);
	switch(readsep(" ")) {
		case "HTTP/1.1":
		case "HTTP/1.0":
			error = real(readsep(" "));
			if(error != 200) {
				return -1;
			}
		break;
		case "":
		loop=false;
		break;
	}
}
setformat(CON,2);
receivemessage(tcp, 50000);
return readsep("|");
It just freezes up, I don't understand why. The show_message never gets shown either.

Fetching A Pixels Luminosity From A Sprite

07 March 2010 - 01:11 AM

so, is it possible to fetching a pixels luminosity from a sprite?
(in gm7)
thank you :wub: