[QUOTE=Maurice;33357141][t]http://i.imgur.com/ERFyQ.png[/t][/QUOTE]
In a real level, I assume, you'll have to rotate the view different ways to get past different obstacles. How will it decide whether to turn green when there are always some gaps somewhere?
[QUOTE=ZenX2;33360392]That concept seems eerily familiar[/QUOTE]
It's [url=http://www.youtube.com/watch?v=GybxIwfU4rI]echochrome[/url].
[QUOTE=Wyzard;33361082]In a real level, I assume, you'll have to rotate the view different ways to get past different obstacles. How will it decide whether to turn green when there are always some gaps somewhere?[/QUOTE]
It only flattens the view to 2D versions of the level (like in the screenshot)
added goals.
[t]http://i.imgur.com/Hg5nB.png[/t]
You can play it if you want. Except for the lack of levels, it's already very much playable.
[url]http://filesmelt.com/dl/fpR20.love[/url]
I wanted to loop through an array in a random order periodically, but the array was so big that creating a shuffle bag would've created unnecessary memory overhead.
So I wrote a random number generator generator. It generates random number generators with a specified, full period. Those generators are then used to loop through the array. I only access "random" indices of the array, but the random number generator is generated so that it's guaranteed to go through every index in exactly as many steps as the array has items.
Results in somewhat obscure code like this:
[csharp]rand = generator.NextRNG(arr.Length);
for (int i = 0; i < arr.Length; i++)
{
arr[rand.Next()]++;
}
// Now every array item has been incremented![/csharp]
[QUOTE=ThePuska;33361655]creating a shuffle bag would've created unnecessary memory overhead.[/QUOTE]
you can shuffle in-place
[editline]20th November 2011[/editline]
and it's an O(n) operation
[QUOTE=icantread49;33362043]you can shuffle in-place
[editline]20th November 2011[/editline]
and it's an O(n) operation[/QUOTE]
It's not the array I wish to shuffle, it's the order in which they're iterated. Storing an array of their indices and shuffling that would've required n additional integers.
[QUOTE=ThePuska;33361655]I wanted to loop through an array in a random order periodically, but the array was so big that creating a shuffle bag would've created unnecessary memory overhead.
So I wrote a random number generator generator. It generates random number generators with a specified, full period. Those generators are then used to loop through the array. I only access "random" indices of the array, but the random number generator is generated so that it's guaranteed to go through every index in exactly as many steps as the array has items.
Results in somewhat obscure code like this:
[csharp]rand = generator.NextRNG(arr.Length);
for (int i = 0; i < arr.Length; i++)
{
arr[rand.Next()]++;
}
// Now every array item has been incremented![/csharp][/QUOTE]
Why exactly is this necessary?
[QUOTE=Yogurt;33362558]Why exactly is this necessary?[/QUOTE]
Reducing visual artifacts and patterns while dithering an image by randomizing the order in which the pixels are processed.
[QUOTE=Nigey Nige;33360536]Considering throwing out my AI completely and making it online multiplayer instead. Tick for go ahead, cross for stupid idea.
[editline]20th November 2011[/editline]
Bear in mind I know nothing about game networking so this'll be a learning exercise.
[editline]20th November 2011[/editline]
ffs this is not helping[/QUOTE]
[url]http://slick.cokeandcode.com/javadoc/org/newdawn/slick/util/pathfinding/AStarPathFinder.html[/url]
[QUOTE=Wyzard;33361082]It's [url=http://www.youtube.com/watch?v=GybxIwfU4rI]echochrome[/url].[/QUOTE]
I was referring to the fact that he's made a game very similar to this before
hey guys check out my cool GUI layout manager :eng101:
[cpp]
#define MAKE_SLIDER_BUTTON(name)\
GUIButton* name##_slide = new GUIButton();\
name##_slide->Size = Vector2(innerW, innerH * 0.2f);\
name##_slide->CanPress = false;\
name##_slide->Position = Vector2(innerX, innerY + innerH * 0.5f - name##_slide->Size.y * 0.5f);\
HolderButton->Add(name##_slide);\
name = new GUIButton();\
name->Size = Vector2(innerW * 0.1f, innerH);\
name->CanDrag = true;\
name->MinPosition = Vector2(innerX, innerY);\
name->MaxPosition = Vector2(innerX + innerW - name->Size.x, innerY);\
name->Position = Vector2(name->MinPosition.x * 0.5f + name->MaxPosition.x * 0.5f, innerY);\
HolderButton->Add(name);\
innerY += innerH + innerYPad
GUIButton* someSlider;
MAKE_SLIDER_BUTTON(someSlider);
[/cpp]
:v:
it's a big mess but hey, it works, it's easy to use, and it makes a pretty GUI!
on a separate note, the only two GUI classes i have are GUIControl and GUIButton ... GUIButton is a one-fits-all solution for buttons, toggle buttons, labels, sliders, image panels, and even scroll panes:
[cpp]
// add scroll pane so the user can scroll through the options
HolderButton = new GUIButton();
HolderButton->Size = Vector2(menuW, bottom);
HolderButton->Position = Vector2(0.0f, 0.0f);
HolderButton->CanPress = false;
HolderButton->CanDrag = true;
HolderButton->ShowButton = false;
MainButton->Add(HolderButton);
[/cpp]
[QUOTE=icantread49;33364351]hey guys check out my cool GUI layout manager :eng101:
[cpp]
Eyesore.
[/cpp]
:v:
it's a big mess but hey, it works, it's easy to use, and it makes a pretty GUI!
on a separate note, the only two GUI classes i have are GUIControl and GUIButton ... GUIButton is a one-fits-all solution for buttons, toggle buttons, labels, sliders, image panels, and even scroll panes:
[cpp]
Eyesore.
[/cpp][/QUOTE]
I wouldn't want to advertise that...
There is this one networking bug I can not find. I hate programming.
[QUOTE=icantread49;33364351]hey guys check out my cool GUI layout manager :eng101:
[cpp]
#define MAKE_SLIDER_BUTTON(name)\
GUIButton* name##_slide = new GUIButton();\
name##_slide->Size = Vector2(innerW, innerH * 0.2f);\
name##_slide->CanPress = false;\
name##_slide->Position = Vector2(innerX, innerY + innerH * 0.5f - name##_slide->Size.y * 0.5f);\
HolderButton->Add(name##_slide);\
name = new GUIButton();\
name->Size = Vector2(innerW * 0.1f, innerH);\
name->CanDrag = true;\
name->MinPosition = Vector2(innerX, innerY);\
name->MaxPosition = Vector2(innerX + innerW - name->Size.x, innerY);\
name->Position = Vector2(name->MinPosition.x * 0.5f + name->MaxPosition.x * 0.5f, innerY);\
HolderButton->Add(name);\
innerY += innerH + innerYPad
GUIButton* someSlider;
MAKE_SLIDER_BUTTON(someSlider);
[/cpp][/QUOTE]
Something tells me a GUIButton* someSlider = makeSliderButton(); function would work equally as well.
I'm not opposed to using the pre-processor to simplify repetitive tasks, but I really don't think it's necessary in your case.
why abstract it into a function when it uses a lot of local variables (innerW, innerH, etc.)
[QUOTE=icantread49;33365802]why abstract it into a function when it uses a lot of local variables (innerW, innerH, etc.)[/QUOTE]
You're using macros, token pasting and staying in the same scope. [b]This is bound to fuck shit up.[/b]
trying to polish up Fabrix - the photo tear & burn app!
[img]http://i.imgur.com/sJNBE.gif[/img]
only thing on my todo list is to add burning
[QUOTE=icantread49;33365802]why abstract it into a function when it uses a lot of local variables (innerW, innerH, etc.)[/QUOTE]
That is a terrible justification.
Even something like this would be better:
[code]
typedef struct slidestyle {
int innerW, innerH;
int padding;
/* whatever */
} slidestyle_t;
void makeButtonSlider(GUIButton *button, slidestyle_t *style) {
/* do stuff that you do in that macro */
}
/* usage: */
slidestyle_t style = { /* define padding, etc. */ };
GUIButton button1, button2, button3;
makeButtonSlider(&button1, &style);
makeButtonSlider(&button2, &style);
makeButtonSlider(&button3, &style);
[/code]
As a general rule, if your macro is accessing local variables, it's probably a really bad thing to macro. Also, three lines or less.
So, after abandoning the Android App Inventor (which is shit), I've decided to try my hand at [url=http://www.scirra.com/construct2]Construct 2[/url].
I'm also looking for a decent cross-platform networking library for C++. So far I've only found SFML and Boost's networking implementations.
[QUOTE=ROBO_DONUT;33365840]That is a terrible justification.
Even something like this would be better:
*code*
[/QUOTE]
what makes that better
[QUOTE=icantread49;33365917]what makes that better[/QUOTE]
It doesn't look like absolute crap, it doesn't access random from values from wherever it's run, it'll produce a smaller binary because you don't have duplicated code, and it's just generally less gross.
[QUOTE=icantread49;33365822]trying to polish up Fabrix - the photo tear & burn app!
[img]http://i.imgur.com/sJNBE.gif[/img]
only thing on my todo list is to add burning[/QUOTE]
Just beware of the iOS submission rules, all finger interactable UI components must have an interaction footprint of at least 28x28px :D
Methodically running HTTP GET on every IP on my subnet at uni accommodation
[IMG]http://i.imgur.com/VTfge.png[/IMG]
It's going well...
[QUOTE=VGS_Devs;33366078]Just beware of the iOS submission rules, all finger interactable UI components must have an interaction footprint of at least 28x28px :D[/QUOTE]
Really? Where does it say that? That's so obscure :v:
[QUOTE=icantread49;33366200]Really? Where does it say that? That's so obscure :v:[/QUOTE]
You surprised? :v:
[QUOTE=icantread49;33366200]Really? Where does it say that? That's so obscure :v:[/QUOTE]
Somewhere in here probably:
[url]http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/Introduction/Introduction.html[/url]
It's probably because of the way iOS handles touches. A touch by a finger in the exact same spot can be different pixel positions. Your finger isn't going to hit the exact same spot every time you touch the screen. Leaving a good amount of space for the finger to touch is usually a good idea. 28px is an odd number though.
[img]http://www.1337upload.net/files/GAME2.PNG[/img]
next step, get a real animated sprite working and move depending on the controls and not just loop through. Using mario tiles because they are easier to get to right now.