Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (565)
Games in Android Showcase (151)
games submitted by our members
Games in WIP (606)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  JGO Grabbag  (Read 2986 times)
0 Members and 1 Guest are viewing this topic.
Online Roquen
« Posted 2014-01-16 12:00:30 »

In the spirit of "It's better to ask forgiveness than permission" I'd started an experiment.

The idea is a non-library of java game related code snippets that one could search through in the same manner as one might have searched through <fill-in the blank of some relative>'s attic when one was a kid looking for treasure.
Offline Oskuro

JGO Knight

Medals: 44
Exp: 6 years

Coding in Style

« Reply #1 - Posted 2014-01-16 14:38:03 »

Pretty nice... Considering I myself have a project on my workspace called "CodeSnippets" where I dump all my code experiments, as well as interesting snippets I take from other people.


Offline Danny02
« Reply #2 - Posted 2014-01-16 14:45:16 »

Yes there are a lot of little interesting code snippets out there and everyone has a util/misc package in his project. Would be nice if we would have a huge repository with many code-snippets of this category.

here three random snippets from my code base which could be usefull 1, 2 & 3
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Oskuro

JGO Knight

Medals: 44
Exp: 6 years

Coding in Style

« Reply #3 - Posted 2014-01-16 18:46:47 »

Would be nice if we would have a huge repository with many code-snippets of this category.

The Shared Code subforum could probably serve that purpose. In fact, I began my CodeSnippets "project" after reading this thread and realizing all those small pieces of code I had spread through my different projects would better be compiled somewhere.... In fact, after I found out Riven's site, my CondeSnippets project now has it's own src.riven package Tongue

(I like to create a package per author of the original code snippets, helps when looking to ask questions Smiley )

Online Roquen
« Reply #4 - Posted 2014-01-17 08:15:08 »

@Danny02: you can add stuff

The rough idea is to be complimentary to shared code/pastebin.  I find that there is code that I think about sharing which I don't because it would be awkward as a shared code post and too messy as a pastebin.  Most of the stuff that I do post is drastically paired down from my existing.
Online Roquen
« Reply #5 - Posted 2014-01-29 14:53:29 »

Hey kids: Sharing is caring!  Make my day and bombard me with requests to be made a contributor.

The PRNG set is now stubbed out...just needs a few tweaks and additions to helper functions.  There 6 main generators which cover all possible use-cases in a game runtime (other than 4K).  Added a novelty generator than runs in both directions.  Added non-progressive Sobol have to decided in advance the number of points you want to generate...generators are reusable.
Online Roquen
« Reply #6 - Posted 2014-02-05 15:36:17 »

Given the popularity of cube-world stuff, uniform 2D grids and the like...added in-order 2D/3D cell walking along line segment or ray.  Barely tested.  Oh and some other stuff:
Online Roquen
« Reply #7 - Posted 2014-02-13 13:43:09 »

I know what ya'll really want:  an arbitrary discrete probability distribution function map.

[start of google translate]
A fixed list of entries each of which has a fixed probability of occurring.  You pass it a pseudo or quasi random number and it selects a matching entry.
[end of translation]

Example usage:  single item drop list or population, fluff text from a unit/NPC, etc.

During the building process instead of providing the extra probabilities you provide "weight" values which indicate relative probabilities.  Example you enter (rock,5) (lint,1) (thing,2).  You're 5 times as likely to get "rock" as a result when compared to "lint" and 2x as likely to get "thing" compared to "lint".  The exact numbers have no meaning.
Online Roquen
« Reply #8 - Posted 2014-03-20 10:18:08 »

Ray/Grid traversal for all touched cells RayGrid{2,3}D and a generic factory.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

theagentd (13 views)
2015-03-27 23:08:20

wxwsk8er (54 views)
2015-03-20 15:39:46

Fairy Tailz (47 views)
2015-03-15 21:52:20

Olo (29 views)
2015-03-13 17:51:59

Olo (32 views)
2015-03-13 17:50:51

Olo (39 views)
2015-03-13 17:50:16

Olo (44 views)
2015-03-13 17:47:07

ClaasJG (58 views)
2015-03-10 11:36:42

ClaasJG (42 views)
2015-03-10 11:33:01

Pippogeek (50 views)
2015-03-05 14:36:23
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!