I'm not familiar with the old SNES 'passing-out' idea. I thought it was about the character falling over 

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Ghost on Wed 16/12/2009 04:39:49
I bet there is a more elegant way to script the whole thing...
Quote from: NsMn on Tue 01/12/2009 05:47:11
Are sure it's that easy pencil? Don't you usually have animations?
Quote from: Khris on Mon 30/11/2009 23:21:36
A jump-n-run would require pretty extensive gravity, movement and collision code, for example.
if(IsKeyPressed(eKeyUpArrow))
{
player.y -= 5;
}
if(IsKeyPressed(eKeyDownArrow))
{
player.y += 5
}
if(IsKeyPressed(eKeyLeftArrow))
{
player.x -= 5;
}
if(IsKeyPressed(eKeyRightArrow))
{
player.x += 5;
}
Quote from: Lyaer on Sat 28/11/2009 08:30:40
You could do an infinite while loop, though it'll lock up before crashing, which might be annoying. Or is that the same as a stack overflow?
function sub1()
{
sub1();
}
Quote from: Calin Leafshade on Thu 26/11/2009 18:58:27
The above code will make time move 40 times faster (or what ever the game speed)
Remember that rep_ex runs every game loop, not every second.
Quote from: Rocco on Sat 21/11/2009 19:42:10
Maybe someday developers with more physic and math knowledge can enhaunce the module.
int Loops = 0;
int Seconds = 0;
int Minutes = 0;
function repeatedly_execute()
{
Loops++
if(Loops == 40) Seconds++;
Change_Time(Seconds);
}
Change_Time(int time)
{
if(time == 60)
{
Minutes++;
Second = 0;
Label1.Text = String.Format("%d:00", Minutes);
return 0;
}
else
{
Label1.Text = String.Format("%d:%d", Minutes, Seconds);
return 0;
}
}
Quote from: Khris on Mon 23/11/2009 19:35:05
...why go through all the trouble of downloading/adding the module and using it when all is needed are a simple GUI and a few lines of code?
int counter = 0;
while(counter <= 100)
{
//do stuff
.
.
.
counter++;
}
for(int counter = 0; counter <= 100; counter++)
{
//do stuff
.
.
.
}
int counter = 0
while(counter <= 23)
{
array[counter] += 5;
}
foreach int counter(array)
{
counter += 5
}
Quote from: wonkyth on Sun 15/11/2009 06:46:54
Well, an integer can only be so big, and if the player was accelerating then it wouldn't take long to reach the limit.
code:
#!/usr/bin/perl -w
use strict;
my $acc = 0;
my $stv = 0;
my @total;
open FILE, ">>", "data.txt" || die $!;
for(my $counter = 1; $counter <= 26; $counter++)
{
my $fv = ($acc*1)+$stv;
push(@total, $fv);
my $total_pixels = 0;
foreach my $element(@total)
{
$total_pixels += $element;
}
print FILE "Loop $counter: $fv Total: $total_pixels pixels\n";
$stv = $fv;
$acc >= 3 ? print "" : $acc++;
}
close(FILE);
output:
Loop 1: 0 Total: 0 pixels
Loop 2: 1 Total: 1 pixels
Loop 3: 3 Total: 4 pixels
Loop 4: 6 Total: 10 pixels
Loop 5: 9 Total: 19 pixels
Loop 6: 12 Total: 31 pixels
Loop 7: 15 Total: 46 pixels
Loop 8: 18 Total: 64 pixels
Loop 9: 21 Total: 85 pixels
Loop 10: 24 Total: 109 pixels
Loop 11: 27 Total: 136 pixels
Loop 12: 30 Total: 166 pixels
Loop 13: 33 Total: 199 pixels
Loop 14: 36 Total: 235 pixels
Loop 15: 39 Total: 274 pixels
Loop 16: 42 Total: 316 pixels
Loop 17: 45 Total: 361 pixels
Loop 18: 48 Total: 409 pixels
Loop 19: 51 Total: 460 pixels
Loop 20: 54 Total: 514 pixels
Loop 21: 57 Total: 571 pixels
Loop 22: 60 Total: 631 pixels
Loop 23: 63 Total: 694 pixels
Loop 24: 66 Total: 760 pixels
Loop 25: 69 Total: 829 pixels
Loop 26: 72 Total: 901 pixels
Loop 1: 0 Total: 0 pixels
Loop 2: 1 Total: 1 pixels
Loop 3: 3 Total: 4 pixels
Loop 4: 6 Total: 10 pixels
Loop 5: 9 Total: 19 pixels
.
.
.
Loop 145: 429 Total: 30889 pixels
Loop 146: 432 Total: 31321 pixels
Loop 147: 435 Total: 31756 pixels
Loop 148: 438 Total: 32194 pixels
Loop 149: 441 Total: 32635 pixels
Loop 150: 444 Total: 33079 pixels
Quote from: RickJ on Sun 15/11/2009 02:31:31
Here is a module that does what you want...
function Downward_acceleration(int Acceleration, int StartingVelocity)
{
//a = (v2-v1)\t
//Acceleration equals Final Velocity minus Initial Velocity over Time
//v2 = at+v1
//Final Velocity equals Acceleration multiplied by Time plus initial velocity
int FinalVelocity = (Acceleration*1)+StartingVelocity;
return FinalVelocity;
}
.
.
.
function repeatedly_execute()
{
if(Ground_collision == false)
{
player.y += Downward_acceleration(YA, YV1);
YV1 += Downward_acceleration(YA, YV1);
if(YA <= 3) YA++;
}
}
Quote from: Victor6 on Sat 14/11/2009 20:09:17
I believe AGS doesn't support 2d arrays, but you probably can use multiple arrays to simulate the same effect.
Quote from: Khris on Sat 24/10/2009 10:40:04Code: ags // header struct str_x { int y[100]; }; // script str_x x[100]; // now one can do: x[40].y[20] = 3;
function repeatedly_execute()
{
Loops++; //Global Variable
if(Loops >= 40)
{
Seconds++; //Global Variable
}
}
function TellTime()
{
while(Seconds >= 60)
{
Minutes++;
}
while(Minutes >= 60)
{
Hours++;
}
while(Hours >= 24)
{
Days++;
}
}
//Assume that Object 39 is reserved as a bullet
function shoot_bullet()
{
if(object[39].Graphic == 0)
{
object[39].Graphic == 1; //sprite no.1 is the bullet (1x1 transparency)
}
else
{
//do nothing
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.038 seconds with 14 queries.