• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:08
CEST 14:08
KST 21:08
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Balance hotfix patch 5.0.16b (July 16)44Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!5Weekly Cups (July 6 - 12): Protoss strike back12BSL Season 22 Full Overview & Conclusion8
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) [D] Wireframe Casting Removed Clem: "I don't have that much hope in Blizzard" Reynor: GSL Loss Wasn't About Preparation Format Is the larve respawn broken?
Tourneys
Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War RSL Revival: Season 6 - Qualifiers and Main Event HomeStory Cup 29
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together Mutation # 532 Nuclear Family
Brood War
General
ASL22 General Discussion BW General Discussion Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) Etiquete rules in Asl? Recent recommended BW games
Tourneys
Escore Tournament - Season 3 [Megathread] Daily Proleagues Small VOD Thread 2.0 [IPSL] Spring 2026 Grand Finals - This Weekend!
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
Path of Exile General RTS Discussion Thread Nintendo Switch Thread Beyond All Reason Stormgate/Frost Giant Megathread
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread UK Politics Mega-thread YouTube Thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Req][Books] Good Fantasy/SciFi books Series you have seen recently...
Sports
2024 - 2026 Football Thread MLB/Baseball 2023 McBoner: A hockey love story Tennis[sport] Formula 1 Discussion
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Poker (part 2)
Nebuchad
The Experiences We Want and …
TrAiDoS
An Exploration of th…
waywardstrategy
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7787 users

The Big Programming Thread - Page 425

Forum Index > General Forum
Post a Reply
Prev 1 423 424 425 426 427 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
xboi209
Profile Blog Joined June 2011
United States1173 Posts
Last Edited: 2014-01-13 01:26:46
January 12 2014 22:34 GMT
#8481
Because multiple programmers much much better than me can't solve my problem, I guess I'm gonna post my code here.

char* offsets[][3] = {
{ "0x3E264", "0", "char[1]" },
{ "0x45848", "Auto-Mine", "char[10]" },
{ "0x458C0", "Auto-Build", "char[10]" },
{ "0x45870", "Multicommand", "char[14]" },
{ "0x45960", "Name Spoof", "char[14]" },
{ "0x45910", "Drop Hack", "char[10]" },
{ "0x3D677", " - Game History:", "char[16]" },
{ "0x3E2A5", "Hacks were detected", "char[19]" },
{ "0x3FD7C", " - Refreshing Game> ", "char[22]" },
//to be continued...
};

HANDLE scHandle = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, ID);
if (scHandle == NULL) {
log << "ERROR: OpenProcess() returned " << GetLastError() << endl;
return false;
}

DWORD bytesOut;

for (int a = 0; a < 9; a++) {
if (WriteProcessMemory(scHandle, (LPVOID)(wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0)), offsets[a][1], strlen(offsets[a][1]) + 1, &bytesOut))
{
log << "WriteProcessMemory() to address " << wDetectorBaseAddress << " + " << (int)strtol(offsets[a][0], NULL, 0) << " = " << wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0) << " with '" << offsets[a][1] << "'; " << bytesOut << " bytes were written" << endl;
}
else
{
log << "ERROR: WriteProcessMemory() returned " << GetLastError() << endl;
return false;
}
}

CloseHandle(scHandle);

just pasted what was necessary, the memory addresses aren't being written to even though my logging shows that WriteProcessMemory() was successful. Also, I've double checked that i have the correct memory addresses as well.
http://www.reddit.com/r/broodwar/
Cyx.
Profile Joined November 2010
Canada806 Posts
January 12 2014 23:51 GMT
#8482
On January 13 2014 07:34 xboi209 wrote:
Because multiple programmers much much better than me can't solve my problem, I guess I'm gonna post my code here.
Show nested quote +

char* offsets[][3] = {
{ "0x3E264", "0", "char[1]" },
{ "0x45848", "Auto-Mine", "char[10]" },
{ "0x458C0", "Auto-Build", "char[10]" },
{ "0x45870", "Multicommand", "char[14]" },
{ "0x45960", "Name Spoof", "char[14]" },
{ "0x45910", "Drop Hack", "char[10]" },
{ "0x3D677", " - Game History:", "char[16]" },
{ "0x3E2A5", "Hacks were detected", "char[19]" },
{ "0x3FD7C", " - Refreshing Game> ", "char[22]" },
//to be continued...
};

HANDLE scHandle = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, ID);
if (scHandle == NULL) {
log << "ERROR: OpenProcess() returned " << GetLastError() << endl;
return false;
}

DWORD bytesOut;

for (int a = 0; a < 9; a++) {
if (WriteProcessMemory(scHandle, (LPVOID)(wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0)), offsets[a][1], strlen(offsets[a][1]) + 1, &bytesOut))
{
log << "WriteProcessMemory() to address " << wDetectorBaseAddress << " + " << (int)strtol(offsets[a][0], NULL, 0) << " = " << wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0) << " with '" << offsets[a][1] << "'; " << bytesOut << " bytes were written" << endl;
}
else
{
log << "ERROR: WriteProcessMemory() returned " << GetLastError() << endl;
return false;
}
}

CloseHandle(scHandle);

just pasted what was necessary, the memory addresses aren't being written to even though my logging shows that WriteProcessMemory() was successful. Also, I've double checked that i have the correct memory addresses as well.

Not exactly my area of expertise, but are you adding your '\0' to the end of the strings before you write them into memory? Because I don't see anywhere where you do, but look like you're writing them into your process's memory with enough space (both in the original arrays and in the WriteProcessMemory()) for the null.
ixmike88
Profile Blog Joined May 2011
United States67 Posts
January 13 2014 00:40 GMT
#8483
string literals are null terminated
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
January 13 2014 01:23 GMT
#8484
Please put it in a [code] BB tags, no one wants to read unformatted code.
There is no one like you in the universe.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
Last Edited: 2014-01-13 02:13:09
January 13 2014 02:04 GMT
#8485
Hey everyone, I finished my Pong game now! This time around I tried to obey Sluggaslamoo and Darkness and make it into a MVC project with clear and small methods. In general, I think I've done so correctly. The only thing that really stands out to me as a potential non-error downside is that when you press Space and are trying to move your paddle at the same time it sometimes stops your paddle. Also, I did a non-decorated Window because the borders were messing up the display. Paddles and the ball would go through the bottom border where they weren't visible, which caused problems.

The link is: https://github.com/WarSame/PongGraeme

EDIT: It contains an executable JAR if you feel like checking it out. Runs right out of the box. Don't need to download anything other than the JAR.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-01-13 02:20:40
January 13 2014 02:17 GMT
#8486
I'm trying to figure out function points: wikipedia
Categories are:
1) user input
2) user output
3) user inquiries
4) internal logic files (e.g. XML, database/tuples?)
5) external interfaces

Can anyone clarify what the 5th can be? The only explanation I've read is "not maintained by application". So, for example mp3s files for an mp3 player then? Or a skin for a web browser? Class files?
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
January 13 2014 02:49 GMT
#8487
On January 13 2014 07:34 xboi209 wrote:
Because multiple programmers much much better than me can't solve my problem, I guess I'm gonna post my code here.

char* offsets[][3] = {
{ "0x3E264", "0", "char[1]" },
{ "0x45848", "Auto-Mine", "char[10]" },
{ "0x458C0", "Auto-Build", "char[10]" },
{ "0x45870", "Multicommand", "char[14]" },
{ "0x45960", "Name Spoof", "char[14]" },
{ "0x45910", "Drop Hack", "char[10]" },
{ "0x3D677", " - Game History:", "char[16]" },
{ "0x3E2A5", "Hacks were detected", "char[19]" },
{ "0x3FD7C", " - Refreshing Game> ", "char[22]" },
//to be continued...
};

HANDLE scHandle = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, ID);
if (scHandle == NULL) {
log << "ERROR: OpenProcess() returned " << GetLastError() << endl;
return false;
}

DWORD bytesOut;

for (int a = 0; a < 9; a++) {
if (WriteProcessMemory(scHandle, (LPVOID)(wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0)), offsets[a][1], strlen(offsets[a][1]) + 1, &bytesOut))
{
log << "WriteProcessMemory() to address " << wDetectorBaseAddress << " + " << (int)strtol(offsets[a][0], NULL, 0) << " = " << wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0) << " with '" << offsets[a][1] << "'; " << bytesOut << " bytes were written" << endl;
}
else
{
log << "ERROR: WriteProcessMemory() returned " << GetLastError() << endl;
return false;
}
}

CloseHandle(scHandle);

just pasted what was necessary, the memory addresses aren't being written to even though my logging shows that WriteProcessMemory() was successful. Also, I've double checked that i have the correct memory addresses as well.


lol you're not going to get advice from here. To ask on SO and give some more information about the problem.
DeltaX
Profile Joined August 2011
United States287 Posts
January 13 2014 02:49 GMT
#8488
I think that is basically the public api of your program or another program. It can either be a specific api that you or another service publicizes to everyone that they can use (like social media share buttons or getting information about your service), or intended for use in your app with ajax calls.

I think that wikipedia page is talking about the first one mostly.

https://dev.twitter.com/docs/api is the twitter version of the first. It allows other people to build on top of twitter and maybe do something like tweet for them.

The second is more for a way of designing a website. You can write some backend api, then in javascript call those apis to get the information to display to the user. You need to make sure they are secure tho as tech savvy users can look through your js files to get that information as well.
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
January 13 2014 03:01 GMT
#8489
On January 13 2014 11:04 WarSame wrote:
Hey everyone, I finished my Pong game now! This time around I tried to obey Sluggaslamoo and Darkness and make it into a MVC project with clear and small methods. In general, I think I've done so correctly. The only thing that really stands out to me as a potential non-error downside is that when you press Space and are trying to move your paddle at the same time it sometimes stops your paddle. Also, I did a non-decorated Window because the borders were messing up the display. Paddles and the ball would go through the bottom border where they weren't visible, which caused problems.

The link is: https://github.com/WarSame/PongGraeme

EDIT: It contains an executable JAR if you feel like checking it out. Runs right out of the box. Don't need to download anything other than the JAR.


Hey just played this, I like it! I didn't take a look at your source but I certainly enjoyed trying out the final product. Congrats on finishing
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
January 13 2014 03:23 GMT
#8490
On January 13 2014 12:01 CecilSunkure wrote:
Show nested quote +
On January 13 2014 11:04 WarSame wrote:
Hey everyone, I finished my Pong game now! This time around I tried to obey Sluggaslamoo and Darkness and make it into a MVC project with clear and small methods. In general, I think I've done so correctly. The only thing that really stands out to me as a potential non-error downside is that when you press Space and are trying to move your paddle at the same time it sometimes stops your paddle. Also, I did a non-decorated Window because the borders were messing up the display. Paddles and the ball would go through the bottom border where they weren't visible, which caused problems.

The link is: https://github.com/WarSame/PongGraeme

EDIT: It contains an executable JAR if you feel like checking it out. Runs right out of the box. Don't need to download anything other than the JAR.


Hey just played this, I like it! I didn't take a look at your source but I certainly enjoyed trying out the final product. Congrats on finishing

Thank you, CecilSunkure, it does mean a lot to me! This was a slog to finish. The Java windows have some odd behaviour...
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
Last Edited: 2014-01-13 06:55:15
January 13 2014 06:31 GMT
#8491
i can access an api here

http://localhost:54978/api/guests/
it shows all the contents in xml
if i use
http://localhost:54978/api/guests/1
it filters out only the one with guestId = 1.
how do you filter it with another property? like firstName?

(urls are just examples for clarification. it cant be accessed)

solved it. something to do with odata
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
WolfintheSheep
Profile Joined June 2011
Canada14127 Posts
January 13 2014 07:13 GMT
#8492
On January 13 2014 15:31 icystorage wrote:
i can access an api here

http://localhost:54978/api/guests/
it shows all the contents in xml
if i use
http://localhost:54978/api/guests/1
it filters out only the one with guestId = 1.
how do you filter it with another property? like firstName?

(urls are just examples for clarification. it cant be accessed)

solved it. something to do with odata

In general, parameters passed through urls are done through POST format (i.e. "viewmessage.php?topic_id=134491&currentpage=425").

Of course, API's basically work however you define them to work.

If you're talking about an existing API, however, well...you'll have to track down the documentation, because this isn't a general question.
Average means I'm better than half of you.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
January 13 2014 07:16 GMT
#8493
im using webAPI and just found out about enabling odata
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
Last Edited: 2014-01-13 08:56:46
January 13 2014 08:54 GMT
#8494
On January 13 2014 16:13 WolfintheSheep wrote:
Show nested quote +
On January 13 2014 15:31 icystorage wrote:
i can access an api here

http://localhost:54978/api/guests/
it shows all the contents in xml
if i use
http://localhost:54978/api/guests/1
it filters out only the one with guestId = 1.
how do you filter it with another property? like firstName?

(urls are just examples for clarification. it cant be accessed)

solved it. something to do with odata

In general, parameters passed through urls are done through POST format (i.e. "viewmessage.php?topic_id=134491&currentpage=425").

Of course, API's basically work however you define them to work.

If you're talking about an existing API, however, well...you'll have to track down the documentation, because this isn't a general question.

Just a minor correction, that's GET data, not POST data. GET data is sent as parameters in the url, POST data is sent as parameters in the request body. Though I guess the actual format of the parameters is the same, parameters are usually sent as urlencoded in POST requests as well.
WolfintheSheep
Profile Joined June 2011
Canada14127 Posts
January 13 2014 18:48 GMT
#8495
On January 13 2014 17:54 Tobberoth wrote:
Show nested quote +
On January 13 2014 16:13 WolfintheSheep wrote:
On January 13 2014 15:31 icystorage wrote:
i can access an api here

http://localhost:54978/api/guests/
it shows all the contents in xml
if i use
http://localhost:54978/api/guests/1
it filters out only the one with guestId = 1.
how do you filter it with another property? like firstName?

(urls are just examples for clarification. it cant be accessed)

solved it. something to do with odata

In general, parameters passed through urls are done through POST format (i.e. "viewmessage.php?topic_id=134491&currentpage=425").

Of course, API's basically work however you define them to work.

If you're talking about an existing API, however, well...you'll have to track down the documentation, because this isn't a general question.

Just a minor correction, that's GET data, not POST data. GET data is sent as parameters in the url, POST data is sent as parameters in the request body. Though I guess the actual format of the parameters is the same, parameters are usually sent as urlencoded in POST requests as well.

Right, yes. That's my bad -_-;
Average means I'm better than half of you.
RoyGBiv_13
Profile Blog Joined August 2010
United States1275 Posts
Last Edited: 2014-01-13 20:52:07
January 13 2014 20:49 GMT
#8496
On January 13 2014 11:49 CecilSunkure wrote:
Show nested quote +
On January 13 2014 07:34 xboi209 wrote:
Because multiple programmers much much better than me can't solve my problem, I guess I'm gonna post my code here.

char* offsets[][3] = {
{ "0x3E264", "0", "char[1]" },
{ "0x45848", "Auto-Mine", "char[10]" },
{ "0x458C0", "Auto-Build", "char[10]" },
{ "0x45870", "Multicommand", "char[14]" },
{ "0x45960", "Name Spoof", "char[14]" },
{ "0x45910", "Drop Hack", "char[10]" },
{ "0x3D677", " - Game History:", "char[16]" },
{ "0x3E2A5", "Hacks were detected", "char[19]" },
{ "0x3FD7C", " - Refreshing Game> ", "char[22]" },
//to be continued...
};

HANDLE scHandle = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, ID);
if (scHandle == NULL) {
log << "ERROR: OpenProcess() returned " << GetLastError() << endl;
return false;
}

DWORD bytesOut;

for (int a = 0; a < 9; a++) {
if (WriteProcessMemory(scHandle, (LPVOID)(wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0)), offsets[a][1], strlen(offsets[a][1]) + 1, &bytesOut))
{
log << "WriteProcessMemory() to address " << wDetectorBaseAddress << " + " << (int)strtol(offsets[a][0], NULL, 0) << " = " << wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0) << " with '" << offsets[a][1] << "'; " << bytesOut << " bytes were written" << endl;
}
else
{
log << "ERROR: WriteProcessMemory() returned " << GetLastError() << endl;
return false;
}
}

CloseHandle(scHandle);

just pasted what was necessary, the memory addresses aren't being written to even though my logging shows that WriteProcessMemory() was successful. Also, I've double checked that i have the correct memory addresses as well.


lol you're not going to get advice from here. To ask on SO and give some more information about the problem.



I'll take this one on.

Can you post or PM me the log when this doesn't work.

Does a WriteProcessMemory() ever work on your process, or is it just these offsets?

Can you open a debugger on the working process and watch the memory change? Maybe changing the memory doesn't do what you expect.

EDIT: Cecil is right that you need to give some more information on the problem when you first report it, otherwise you'll have to have several back-and-forth exchanges before even an expert on your problem can help you gain new insight. This is probably why you had trouble getting help from "better" programmers earlier. A good resource for how to ask questions is here: http://www.catb.org/~esr/faqs/smart-questions.html
Any sufficiently advanced technology is indistinguishable from magic
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
January 13 2014 21:40 GMT
#8497
On January 14 2014 05:49 RoyGBiv_13 wrote:
Show nested quote +
On January 13 2014 11:49 CecilSunkure wrote:
On January 13 2014 07:34 xboi209 wrote:
Because multiple programmers much much better than me can't solve my problem, I guess I'm gonna post my code here.

char* offsets[][3] = {
{ "0x3E264", "0", "char[1]" },
{ "0x45848", "Auto-Mine", "char[10]" },
{ "0x458C0", "Auto-Build", "char[10]" },
{ "0x45870", "Multicommand", "char[14]" },
{ "0x45960", "Name Spoof", "char[14]" },
{ "0x45910", "Drop Hack", "char[10]" },
{ "0x3D677", " - Game History:", "char[16]" },
{ "0x3E2A5", "Hacks were detected", "char[19]" },
{ "0x3FD7C", " - Refreshing Game> ", "char[22]" },
//to be continued...
};

HANDLE scHandle = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, ID);
if (scHandle == NULL) {
log << "ERROR: OpenProcess() returned " << GetLastError() << endl;
return false;
}

DWORD bytesOut;

for (int a = 0; a < 9; a++) {
if (WriteProcessMemory(scHandle, (LPVOID)(wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0)), offsets[a][1], strlen(offsets[a][1]) + 1, &bytesOut))
{
log << "WriteProcessMemory() to address " << wDetectorBaseAddress << " + " << (int)strtol(offsets[a][0], NULL, 0) << " = " << wDetectorBaseAddress + (int)strtol(offsets[a][0], NULL, 0) << " with '" << offsets[a][1] << "'; " << bytesOut << " bytes were written" << endl;
}
else
{
log << "ERROR: WriteProcessMemory() returned " << GetLastError() << endl;
return false;
}
}

CloseHandle(scHandle);

just pasted what was necessary, the memory addresses aren't being written to even though my logging shows that WriteProcessMemory() was successful. Also, I've double checked that i have the correct memory addresses as well.


lol you're not going to get advice from here. To ask on SO and give some more information about the problem.



I'll take this one on.

Can you post or PM me the log when this doesn't work.

Does a WriteProcessMemory() ever work on your process, or is it just these offsets?

Can you open a debugger on the working process and watch the memory change? Maybe changing the memory doesn't do what you expect.

EDIT: Cecil is right that you need to give some more information on the problem when you first report it, otherwise you'll have to have several back-and-forth exchanges before even an expert on your problem can help you gain new insight. This is probably why you had trouble getting help from "better" programmers earlier. A good resource for how to ask questions is here: http://www.catb.org/~esr/faqs/smart-questions.html

Hey I'd actually be interested in seeing the result of this! Could you please PM me the details later? I'll try to ask you about it later too (unless I forget!)
sluggaslamoo
Profile Blog Joined November 2009
Australia4494 Posts
January 13 2014 22:52 GMT
#8498
On January 13 2014 11:04 WarSame wrote:
Hey everyone, I finished my Pong game now! This time around I tried to obey Sluggaslamoo and Darkness and make it into a MVC project with clear and small methods. In general, I think I've done so correctly. The only thing that really stands out to me as a potential non-error downside is that when you press Space and are trying to move your paddle at the same time it sometimes stops your paddle. Also, I did a non-decorated Window because the borders were messing up the display. Paddles and the ball would go through the bottom border where they weren't visible, which caused problems.

The link is: https://github.com/WarSame/PongGraeme

EDIT: It contains an executable JAR if you feel like checking it out. Runs right out of the box. Don't need to download anything other than the JAR.


Its much better than your first so well done.

However its not really MVC as there are no models.

Make sure to create a class for each component in your project. Not because its MVC but because of OOP, object decomposition is fundamental to OOP. If you aren't decomposing your project into separate objects, then you may as well not be using Java .

You don't really need to think too hard about it either. What does a Ping Pong game consist of? Think about that, then make the appropriate classes and place the logic there.

Your code would be ok if it was written in a non-OO language though.
Come play Android Netrunner - http://www.teamliquid.net/forum/viewmessage.php?topic_id=409008
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
Last Edited: 2014-01-14 01:10:12
January 14 2014 01:09 GMT
#8499
On January 14 2014 07:52 sluggaslamoo wrote:
Show nested quote +
On January 13 2014 11:04 WarSame wrote:
Hey everyone, I finished my Pong game now! This time around I tried to obey Sluggaslamoo and Darkness and make it into a MVC project with clear and small methods. In general, I think I've done so correctly. The only thing that really stands out to me as a potential non-error downside is that when you press Space and are trying to move your paddle at the same time it sometimes stops your paddle. Also, I did a non-decorated Window because the borders were messing up the display. Paddles and the ball would go through the bottom border where they weren't visible, which caused problems.

The link is: https://github.com/WarSame/PongGraeme

EDIT: It contains an executable JAR if you feel like checking it out. Runs right out of the box. Don't need to download anything other than the JAR.


Its much better than your first so well done.

However its not really MVC as there are no models.

Make sure to create a class for each component in your project. Not because its MVC but because of OOP, object decomposition is fundamental to OOP. If you aren't decomposing your project into separate objects, then you may as well not be using Java .

You don't really need to think too hard about it either. What does a Ping Pong game consist of? Think about that, then make the appropriate classes and place the logic there.

Your code would be ok if it was written in a non-OO language though.

Thanks for the feedback. For MVC I thought that View = user display, Model = data, Control = controlling logic. As I saw it the Model was PongData, the View was PongPanel and the Control was PongFrame. I guess I really misunderstood what MVC is. Looking at Wikipedia this seems like it might be an example of a passive model, though, where the view is updated from the model by polling(by running the heartbeat cycle with sleep lengths). Maybe not, and honestly this is confusing me quite a bit by this point. Could you point out what you believe would make this into an MVC project?

As for making a class for each component of the project, I'm not really sure what you mean by that. Do you mean I should make one for Ball(with an X and Y value/speed), one for Paddle, and so on like that? If so, you are definitely right and I regret not doing that. If not could you please clarify it? And thanks for the feedback throughout, I definitely appreciate it. This project was a lot easier to handle organization-wise than the last one for Tic Tac Toe.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
sob3k
Profile Blog Joined August 2009
United States7572 Posts
January 14 2014 01:30 GMT
#8500
If I want to add H1-H6 headers to a previously made page for SEO purposes, if there any way for me to remove all formatting from them? I just want to stick them on as SEO markers and not have them effect the site visibly at all. Right now they break all kinds of stuff. I tried some resets but none of them reduce the headings to just tags.
In Hungry Hungry Hippos there are no such constraints—one can constantly attempt to collect marbles with one’s hippo, limited only by one’s hippo-levering capabilities.
Prev 1 423 424 425 426 427 1032 Next
Please log in or register to reply.
Live Events Refresh
WardiTV Invitational
12:00
Summer Cup 2026 - Group A
WardiTV171
LiquipediaDiscussion
CranKy Ducklings
10:00
Master Swan Open #105
CranKy Ducklings63
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Ryung 904
Lowko401
SortOf 153
Rex 111
BRAT_OK 66
MindelVK 28
RushiSC 13
StarCraft: Brood War
Calm 5879
Rain 2516
Shuttle 1711
firebathero 849
Jaedong 679
Horang2 530
Hyuk 463
BeSt 403
Mini 309
Larva 185
[ Show more ]
Stork 176
Rush 153
Last 151
ZerO 146
Hyun 125
hero 89
Killer 75
ggaemo 71
Pusan 70
Sharp 65
Mong 62
Free 45
JYJ 40
Aegong 35
ZergMaN 34
soO 32
JulyZerg 32
sorry 29
Shine 27
Movie 21
Barracks 17
HiyA 17
yabsab 16
Hm[arnc] 15
ajuk12(nOOB) 12
Noble 9
IntoTheRainbow 9
Dota 2
Gorgc4533
XcaliburYe263
League of Legends
Doublelift2194
Counter-Strike
byalli1367
Heroes of the Storm
Trikslyr23
Other Games
gofns14835
singsing1674
B2W.Neo861
RotterdaM225
Happy192
XaKoH 129
ZerO(Twitch)7
Organizations
Other Games
gamesdonequick2511
BasetradeTV154
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• epiclan15
• Adnapsc2 13
• CranKy Ducklings SOOP7
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Pr0nogo 2
• FT.aCt)Sony1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2205
Upcoming Events
Epic.LAN
53m
IPSL
3h 53m
Dragon vs Hawk
RSL Revival
20h 53m
Classic vs Trap
herO vs SHIN
Sparkling Tuna Cup
21h 53m
OSC
1d
IPSL
1d 3h
Bonyth vs Ret
WardiTV Weekly
1d 22h
Monday Night Weeklies
2 days
PiGosaur Cup
3 days
The PondCast
3 days
[ Show More ]
Replay Cast
4 days
CrankTV Team League
4 days
Replay Cast
5 days
CrankTV Team League
5 days
Korean StarCraft League
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Escore Tournament S3: W3
HSC XXIX
Eternal Conflict S2 E2

Ongoing

IPSL Spring 2026
Acropolis #4
YSL S3
CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.