[QUOTE=Larikang;37432810][URL]https://github.com/Metapyziks/Spryt[/URL]
[URL="http://facepunch.com/showthread.php?t=1202224&p=37078090&viewfull=1#post37078090"]WAYWO Post[/URL]
But he hasn't posted any updates in WAYWO for a while, so I'm not sure of its current status.[/QUOTE]
nah that must be different, thanks though
[QUOTE=Richy19;37432340]What would be a better way of doing the frustruc culling then?[/QUOTE]
[url=http://www.lighthouse3d.com/tutorials/view-frustum-culling/]This[/url] is a good article.
ok so i get a warning when using int difficulty this is the warning [QUOTE]warning C4700: uninitialized local variable 'difficulty' used[/QUOTE]
what am i exactly doing wrong here
[code]#include "stdafx.h"
#include "iostream"
#include "string"
using namespace std;
//BY: Pheonix software & Iceberg entertainment
int _tmain(int argc, _TCHAR* argv[])
{
int mode[3] = {0, 1, 2 };
int difficulty;
string name;
int player = 100;
int enemy = 100;
int turn = 1;
int roll = rand() % 20 - 0;
int damage = 5;
int damage2 = 10;
int damage3 = 15;
cout << "Welcome! what is your name?: ";
getline(cin, name);
cout << "Welcome to East L.A. Shootout " << name << "! you are the new cop on the East side of L.A. Your patroling down the street when you notice a couple robbing a store.\n You turn your sirens on and cut off their pathway and quickly get out and pull out your weapon...the shootout begins.";
cout << "Choose difficulty(0-2): " << difficulty;
getline(cin, difficulty);
while((enemy = 0) || (player = 0))
{
switch (difficulty)
{
case 0:
cout << "roll";
turn = 1;
if(roll >= 15)
{
cout << "The shot hit";
int turn = 2;
int roll = rand() % 20 - 0;
enemy = 100 - damage;
}
else if(roll < 15)
{
cout << "The shot missed";
turn = 2;
int roll = rand() % 20 - 0;
player = 100 - damage;
}
break;
case 1:
cout << "roll";
turn = 1;
if(roll >= 15)
{
cout << "The shot hit";
int turn = 2;
int roll = rand() % 20 - 0;
enemy = 100 - damage;
}
else if(roll < 15)
{
cout << "The shot missed";
turn = 2;
int roll = rand() % 20 - 0;
player = 100 - damage2;
}
break;
case 2:
cout << "roll";
turn = 1;
if(roll >= 15)
{
cout << "The shot hit";
int turn = 2;
int roll = rand() % 20 - 0;
enemy = 100 - damage;
}
else if(roll < 15)
{
cout << "The shot missed";
turn = 2;
int roll = rand() % 20 - 0;
player = 100 - damage3;
}
break;
default:
//whatever goes here
}
getchar();
}
return 0;
}[/code]
Your while switch, it should be enemy==0 not enemy =0. One is a check, the other an assignment.
[QUOTE=WTF Nuke;37434433]Your while switch, it should be enemy==0 not enemy =0. One is a check, the other an assignment.[/QUOTE]
aw shit i didn't see that
[editline]27th August 2012[/editline]
still doesn't fix the difficulty issue that's what i can't figure out
you output dificulty
cout << "Choose difficulty(0-2): " << difficulty;
when it hasnt been set yet
[QUOTE=Richy19;37434582]you output dificulty
cout << "Choose difficulty(0-2): " << difficulty;
when it hasnt been set yet[/QUOTE]
ah ok, i should mention i'm converting it from applescript so i missed a minute detail
[editline]27th August 2012[/editline]
ok still getting this warning even after setting it this shit is starting to piss me off
just set it to 0 or something
int difficulty=0;
[QUOTE=Richy19;37434876]just set it to 0 or something
int difficulty=0;[/QUOTE]
ok i got it to display up to difficulty setting, how ever it puts a zero in place where there shouldn't be anything
[editline]27th August 2012[/editline]
i really don't think i should be programming today, I'm forcing myself to do it right now which is causing me to overlook things
lol remove dificulti from cout << "Choose difficulty(0-2): " << difficulty;
[editline]28th August 2012[/editline]
Knowing the lookat and position vectors of a camera,
can you get direction by just: lookat - pos
[QUOTE=Richy19;37435148]lol remove dificulti from cout << "Choose difficulty(0-2): " << difficulty;
[editline]28th August 2012[/editline]
Knowing the lookat and position vectors of a camera,
can you get direction by just: lookat - pos[/QUOTE]
yeah i did that it's all good now
I've gotta be mentally retarded or something. I use to be able to do this, but I completely forgot how. I'm trying to make it so it will leave a trail wherever it goes, but limited to a certain amount of lines per planet.
[vid]https://dl-web.dropbox.com/get/Public/lines.webmvp8.webm?w=35e633b8[/vid]
[CODE]void UpdateLines(Planet planets[],int num,ALLEGRO_FONT* font24){
planets[num].tX[0] = planets[num].x;
planets[num].tY[0] = planets[num].y;
for(int i=1; i<10;i++){
planets[num].tX[i] = planets[num].tX[i-1];
planets[num].tY[i] = planets[num].tY[i-1];
al_draw_line(planets[num].tX[i-1],planets[num].tY[i-1],planets[num].tX[i],planets[num].tY[i],al_map_rgb(255,255,255),4);
if(num == 0){
al_draw_textf(font24,al_map_rgb(255,0,255),5,5+((i)*20),0,"%f, %f",planets[num].tX[i],planets[num].tY[i]);
}
}
if(num == 0){
al_draw_textf(font24,al_map_rgb(255,0,255),5,5,0,"%f, %f",planets[num].tX[0],planets[num].tY[0]);
}
}[/CODE]
This might be considered sloppy, seeing as it's been a while since I've done any programming at all. Any help at all is appreciated.
so i trashed the switch, it got too complicated
Please don't use _tmain.
Anyone interested in making a fairly simple iPhone app with me? ([B]PAID: 1200-2000€[/B], depending on quality, split 50-50). It's a small puzzle game with (currently) 2 gamemodes for a company that makes maps. The games are simple - a county jigsaw and an 'estimate the location of x'. Should have low-key facebook integration (using the new timeline shitz). I've got most of the graphics done.
I've been working on it with a friend from uni for this company but he's being a massive arsehole and can't be arsed to do it at all + is ignoring the company e-mails.
Who wants to make it with me, drop me a PM and I'll explain further.
Wait, why are you Hitler
[QUOTE=esalaka;37439598]Wait, why are you Hitler[/QUOTE]
.. This isn't new.
[QUOTE=Jaanus;37439551]Anyone interested in making a fairly simple iPhone app with me? (paid: 1200-2000€, depending on quality, split 50-50)
I've been working on it with a friend from uni for this company but he's being a massive arsehole and can't be arsed to do it at all + is ignoring the company e-mails.
Who wants to make it with me, drop me a PM and I'll explain further.[/QUOTE]
Your better off aasking in WAYWO, more people view that.
Damn wish I could code iOS apps, could do with that extra cash :(
[QUOTE=esalaka;37439598]Wait, why are you Hitler[/QUOTE]
Because I hate juice
[editline]28th August 2012[/editline]
and because I'm a moderator but that's obvious
[QUOTE=Jookia;37439182]Please don't use _tmain.[/QUOTE]
that's part of the template
I got an OGL problem and I'm not quite sure how to solve it. In the past, I didn't have to have a Z layer for my game because I drew things in sequence, so the things drawn last are in the background, etc. Now, however, I need to draw the player before the tiles, and I have set it so that the player has a higher Z value than the tiles. All is good and the player is visible above the tiles. However, the player's sprite also has transparency, but since the part where the player is doesn't have anything drawn behind it (due to the depth test), the transparency does not show the underlying tiles, but rather the clear color. Is there a way to fix this?
[QUOTE=WTF Nuke;37447128]I got an OGL problem and I'm not quite sure how to solve it. In the past, I didn't have to have a Z layer for my game because I drew things in sequence, so the things drawn last are in the background, etc. Now, however, I need to draw the player before the tiles, and I have set it so that the player has a higher Z value than the tiles. All is good and the player is visible above the tiles. However, the player's sprite also has transparency, but since the part where the player is doesn't have anything drawn behind it (due to the depth test), the transparency does not show the underlying tiles, but rather the clear color. Is there a way to fix this?[/QUOTE]
This can only be fixed by drawing the player after the background. This is also done in 3D games by depth sorting. What is the reason that this is not possible?
[QUOTE=Overv;37447526]This can only be fixed by drawing the player after the background. This is also done in 3D games by depth sorting. What is the reason that this is not possible?[/QUOTE]
Just wanting to keep everything related to an entity on the entity, for a component based system.
[QUOTE=confinedUser;37443566]that's part of the template[/QUOTE]
Fuck the templates.
I'm getting HEAP CORRUPTION ERROR (in caps, mind you).
I'm sure it has to do with resource-releasing/freeing, but I can't see how I am releasing any resources twice. However, I may be attempting to free a pointer to a resource rather than the resource itself, which would explain it.
It's a pointer to a GLuint array.
[cpp]GLuint* texRT;[/cpp]
This is how it's initialized:
[cpp]texRT = new GLuint[0];[/cpp]
I'm freeing it like so:
[cpp]RenderTarget::~RenderTarget()
{
printf("- Deleting rendertarget...");
delete[] texRT;
printf("Done.\n");
}[/cpp]
I've got some printfs there to help me out. I get a heap corruption error between those. Am I doing this wrong? I tried doing "&texRT" upon deletion, but that didn't work.
You are allocating 0 bytes of memory?
[editline]29th August 2012[/editline]
Never mind, apparently passing a pointer to 0 blocks of memory to array delete is fine.
[QUOTE=MakeR;37456770]You are allocating 0 bytes of memory?
[editline]29th August 2012[/editline]
Never mind, apparently passing a pointer to 0 blocks of memory to array delete is fine.[/QUOTE]
Doesn't make it less damn weird
[QUOTE=esalaka;37457164]Doesn't make it less damn weird[/QUOTE]
Indeed, dereferencing it though is undefined.
Changed it to 1, and now it works.
I have a problem where my load-function can happen in the middle of an update-function. Any tips on delaying the load until the update has finished?
Nevermind. Figured it out. Something like this:
[cpp]// Check if loading has been initiated and go to new state
if (initLoad)
{
isLoading = true;
GoToState(newState);
initLoad = false;
}[/cpp]
[QUOTE=Jookia;37448088]Fuck the templates.[/QUOTE]
it's the only way i can compile it into a program i don't know any other way.
anyways i seem to have hit a brick wall here, i finished my code but my linker seems to be broken resulting in a fatal error. How can i fix this?
Sorry, you need to Log In to post a reply to this thread.