fastcall22

Moderators
  • Content count

    2493
  • Joined

  • Last visited

Community Reputation

10838 Excellent

About fastcall22

  • Rank
    Web Developer

Personal Information

  • Interests
    Programming

Recent Profile Visitors

25827 profile views
  1. a hidden spring

    Looks great! Though, it’s hard to tell the foreground from the noisy background.
  2. Leaderboards Without a server?

    Close; that last part is reversed. The game website should either query the database directly or consume the API that your game will use, and render the leaderboard on the fly. The game website, the database, and the highscore API need not be on different servers. Apache2, as well as other webservers, can be configured to direct requests to separate processes/scripts depending on the subdomain(s) used in the requests’ `Host` header. Then, you can configure your domain to point all the subdomains to the correct servers.
  3. Leaderboards Without a server?

    Apache is a web sever that manages TCP connections for HTTP communication. Apache delegates the TCP connection to another script or process, which then processes the request and prepares an appropriate HTTP response with data. With the appropriate accompanying apache2 module, you can use PHP, Python, or even Perl. This is the easiest approach. Another alternative is to write a program that listens to TCP connections on port 80, and handle the HTTP request/response yourself. The idea with either approach is to handle the two major functions of a leader board: Fetch the top ranking scores of all time Add a high score entry
  4. 2017.07.11. GIF Monster Skills

    Looks great!
  5. Open Source Creating Render System

    Moving to Your Announcments .
  6. C++ and SDL2 Tile Collision

    A free–moving tile can cover at most four tiles. Store the dimensions of the player as floats, use these and the velocity to determine which tiles to check for collision. Once you’ve found the nearest colliding tile in each the X and Y directions, clamp the X or Y component of the player’s velocity such that the player does not collide with the tile(s). This will allow for sliding and will prevent sticking and jittering. Here are a few helpful resources I found: http://www.metanetsoftware.com/technique/tutorialA.html http://jonathanwhiting.com/tutorial/collision/
  7. Funny Trump future history symbolic-RPG

    Looking for critique? Writ about your script in Writing for Games. Recruiting people? Detail the project itself and then try Hobby Project Classifieds.
  8. Abusing -1 rep

    We’ve taken care of the problem users, and we will reverse the vote manipulation. :^)
  9. HTML5 RSS Feed w/ matching style?

    There are some non–obvious problems with this setup, but let’s cover some CSS basics first. Every HTML element has a set of properties that describe how it should be laid out on a page and how it should rendered. They can be accessed with it’s style property in Javascript. You can write Javascript or add a style attribute to each HTML element to give your page the look and feel, but it quickly becomes tedious and cumbersome. Enter CSS. It allows you to apply styles to elements determined by rules. These rules can even be stored in a separate file, so you don’t have to clutter your HTML. Here’s a CSS cheatsheet. Now, on to style matching. If you want to match styles, then open your browser’s developer tools and inspect random elements on the page. Poke at their CSS properties and find out what they’re made of. Take note of font-family, font-size, line-height, color, background, padding, and margin properties as they are a significant chunk of the look and feel. -- Next, let’s talk about RSS. When querying an RSS feed, you are met with an XML document with a summary of recent posts. Here’s an example RSS feed. The problem is that this XML isn’t usable HTML. It will need to be transformed into HTML. You’ve opted to use rssdog.com do this for you. The query string parameters you pass to rssdog tells it which RSS feed to fetch and how to render that HTML, along with some basic styling. By using an iframe tag with this URL, the user’s browser will make a separate request on your homepage to rssdog with your parameters and rssdog will fill that space with the resulting HTML. Browsers are particular about cross–domain interactions for good reason, so while this iframe is a part of your homepage, it is a considered a separate web page and has protections against modification. More on this later. -- So, options at this point: Render the XML yourself, server side. This is the easiest option as you can embed the resulting HTML directly into your page and you can retain your styling. You will need to research what server side languages are available with your web hosting provider. You will then need insert a server side script on your homepage that will download the XML from the RSS feed (using CURL, for example), traverse the resulting XML document, and render the HTML. Render the XML yourself, client side. Include some Javascript to invoke an XHR request to your feed, receiving the XML, and dynamically creating HTML elements from it. This requires that the server send a Access-Control-Allow-Origin header to grant access from shogun3d.net to blog.shogun3d.net. Check your web hosting provider on how to send that header. After enabling the option, use the network tab on your developer tools to ensure that the header was sent. (Be sure to hard refresh to prevent your browser using a cached version of the page and headers.) The theme you have selected has jQuery included, so you can use jQuery.ajax to fetch your XML. Otherwise, you can use a raw XMLHttpRequest. Manually sync your homepage with your blog. This is the most annoying option.
  10. Since the items are referred to by their tag, then it would be easier to use an associative array, such as `dict` or `collections.OrderedDict`. Then, checking if the inventory is full is only a matter of checking the number of tags it has: items = dict() def is_full(self): return len(self.items) >= 8 You are correct in that it is misleading to add an item and not actually have an item added. This is why it is important to signal if an action succeeded and (optionally) provide other ways to determine if an action will succeed. For example: class Inventory: max_inventory_size = 8 def __init__(self): self.items = dict() @property def full(self): return len(self.items) >= self.max_inventory_size def can_accept(self, item): return item.tag in self.items or not self.full def try_add_item(self, item): if not self.can_accept(item): return False self.add_item(item) return True def add_item(self, item): target = self.items.get(item.tag, None) if target is not None: target.quantity += item.quantity else: assert not self.full, "Inventory full" self.items[item.tag] = item # and then: (1) # expect this action to succeed, otherwise crash hard inv.add_item(item) # or: (2) # lazily attempt action, not caring if it fails if inv.try_add_item(item): world.remove(item) # or: (3) # don’t attempt action, but do check if it is possible for shop_entry in shop_menu: if not inv.can_accept(shop_entry.item): shop_entry.enabled = False
  11. Beginner stuck with programming Java

    At this very moment, no, but it’s still too early to tell! :^) Programming is an art and can more or less carry over to other languages; don’t worry about choosing the “right language” and just focus on learning the fundamentals with one. Read up on Peter Norvig’s Teach Yourself Programming in Ten Years, and reflect on where you are at now with Java. Good luck!
  12. Temporary radio silence

    Of all the blog posts that needs pictures, this needs it the most… !! ᕕ( ᐛ )ᕗ
  13. Dewitters Game Loop - Understanding

    Gaffer addresses this by clamping the elapsed time per loop to a certain number of updates. There are other ways this can happen as well, such as pausing the game while you’re in the debugger. :^)
  14. Dewitters Game Loop - Understanding

    That’s more or less the gist of the game loop. I recommend also supplementing your reading with Gaffer’s Fix Your Timestep. It is a similar implementation and may answer your other questions.
  15. Slowest AABB overlap test ever?

    bool intersects(const AABB& a, const AABB& b) { AABB test = { min(max(a.min, b.min), b.max), min(max(a.max, b.min), b.max), }; return (test.max - test.min).sq_len() > FLOAT_EPSILON; } Erm, I mean… Post each query to a math forum, using a rendering of the two AABBs on a 3D graph. If the account gets banned for spamming, just keep making new ones.