Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Ronan

Members
  • Joined

  • Last visited

Everything posted by Ronan

  1. Furthermore - don't go for time-constrained, dodgy solutions! :P The way I fixed it before it made the rocket explode a bit early obviously at certain rotations. Rather, based upon the problem I've figured out the rotation point for the Tip of the missile, then modified it's location so it's at the same point as it was before and further modified the image's coordinates to make it display appropriately for rotation. This way it seems to work perfectly and as we're processing movement after moving the image's coordinates, it doesn't affect the position in a negative way! :) The fixed method, before clean-up is here if anyone's interested in it :- [spoiler=processMove()] private void processMove() { theta = Methods.AngleBetweenPoints(new Point2D.Double(tipX, tipY), new Point2D.Double(mouseX, mouseY)); AffineTransform at = AffineTransform.getRotateInstance(theta, rocket.getWidth() / 2, rocket.getHeight() / 2); Point2D newTip = at.transform(new Point2D.Double(rTipX, rTipY), null); double startingTipX = tipX; double startingTipY = tipY; tipX = rocketX + newTip.getX(); tipY = rocketY + newTip.getY(); double dX = tipX - startingTipX; double dY = tipY - startingTipY; tipX = startingTipX; tipY = startingTipY; rocketX = tipX - dX; rocketY = tipY - dY; double xChange = Methods.xComponent(4, theta); double yChange = Methods.yComponent(4, theta); tipX += xChange; tipY += yChange; rocketX = tipX - newTip.getX(); rocketY = tipY - newTip.getY(); theta = Math.toRadians(Math.toDegrees(theta) + 90); } If anyone's interested in the code and the final solution (for the moment :P), it's uploaded here :- mediafire.com/?zmw0ddzn1jy Edit :- (Changed the explosion effect just slightly from the last uploaded source - rather than use an image, i've just got an increasing-size circle to tie in more with later ideas.) Also wondering if this forum could be used for development 'plotting' purposes, pretty much to track and publish development - although I guess there's blogs for that...
  2. You've just given me another idea to add to my notes for ideas to develop with Java! :^_^: I think something like this would be fantastic if it could be provided in a manageable way, WarriorMonk's image certainly looks brilliant - if we could get past the limitations I bet this would be a very appreciated feature.
  3. Microsoft released a PowerToy for Windows XP titled Virtual Desktop Manager that does pretty much this, you could find it at this link: Microsoft Powertoys Other than that, or if you're not on XP then I believe there's numerous Apps around, like this one on SourceForge: VirtuaWin. That one may be good as it advertises itself as being similar to the Linux / Unix feature.
  4. I managed to solve it! :) The problem was in that it was trying to rotate to point in the direction of the mouse, but when close enough, due to the size of the image it was rotating the tip of the missile to the 'opposite' side of the mouse, and rotating back and forth due to that. I've put a check on both the tip of the rocket and the image coordinates for collision and that seems to be working a lot better and with minimal side-effects. Thanks both y_guy and sees_all for helping! :smile:
  5. Funnily enough I tried implementing that idea previously, logically it sounded entirely feasible, and yet the problem was still occurring afterwards. <_< Likely it was an issue with my implementation of it but it certainly seems that I should rethink the system if it's causing this amount of confusion, flashes warning signs for future development!
  6. Added the main snippets from the code up there, it's pretty messy at the moment due to being a mock-up but should be readable. I've got a canvas with a rocket moving around in it. I'd like this rocket to move towards the mouse cursor, which can be moved around, at a steady interval. Upon collision with the mouse cursor, it should 'explode', removing the rocket and displaying an explosion animation at that point. The rocket should be rotated towards the mouse cursor location upon every update to look like it's 'tracking' the mouse. The collision is based on the tip of the rocket touching the mouse-cursor's location and the tip of the rocket is a bit offset from the top-left of the image. Edit :- Had a slight breakthrough with this. From what I can tell, it's inconsistent to check for collision based upon the tip of the rocket and yet move the image based on the top-left of the image coordinates. I'll redesign the movement method to process 'everything' based upon the tip of the rocket and then calculate where the image should be drawn from that, rather than the other way around. Seems to make more sense the way I'm looking at it, but have to wait and see! :)
  7. The Rocket is represented by a custom-designed Animation class, that all works ok though so it can simply be assumed to be the same as an Image. The rocket is supposed to follow the mouse around, in a reasonable fashion, basically moving in the direction of the mouse by a specified interval every update, rotated to point in the direction of the mouse. Upon the tip of the rocket touching the mouse location, it should explode. Because of the way the images have been created, a square due to rotation issues, the point of the rocket isn't the same as the X,Y location of the image. Rather, it's (initially, at 0 Radians rotation) at ImageX + 30, ImageY. Due to this, whenever the image is updated and moved towards the mouse position, and rotated, the tip of the rocket's (X,Y) location must be calculated too, this seems to be done fine. For collision, and exploding, we want it to occur when the tip of the rocket hits the mouse location. Sometimes this occurs fine, but in certain instances, seemingly when the rocket should only move a small distance towards the mouse (i.e When the mouse is close to the rocket's previous location), it distorts and flips around the mouse pointer, never exploding as the tip is never equal / close to the mouse's location. The problem is with that, something's up with the logic / math when moving the position of the rocket when it's very close to the mouse cursor. And it's one of those annoying, hard to diagnose issues so frequently found in programming! :P
  8. It's not the explosion that's an issue, that's all working fine - rather it's the movement of both the image (x,y) location and the rocket-tip (x,y) location. I believe that as it gets close, it is pushed past the mouse-location but I'm not certain. I've varied the distance upon which the explosion occurs and yet the issue still occurs if the mouse is moved close enough to the tip of the rocket. :unsure: It's a rather strange issue and pretty tricky to describe, if you can run the code at some point you'll see the symptoms. :)
  9. I finished building my Space Invaders / Arcadians clone the other day, so I've settled on starting another project I thought up whilst developing the previous game. Currently it's all simply floating around in my head apart from mindless notes scribbled everywhere, but whenever I get the time to get round to it I'll get the brief down on paper in a (somewhat) orderly fashion. The basic idea of the game will be a rocket / missile following the player's mouse with targets in a level to destroy based on the explosion of the rocket. Of-course, got all sorts of additions like obstacles, rocket-fuel perhaps, enemies (room for some A.I!), but that's all to come. Right now, I drew up a very quick base for the rocket and animation. It's the first time I've done an animated-style object in Java but I think that's working reasonably. My problem is with the Rocket exploding upon contact with the mouse location. Sometimes it works, others it goes very odd. As far as I can tell, it's because I'm forcing it to move too large a distance 'over' the mouse-location, making it jump back and forth past the mouse very quickly. But at the moment, I've hardly got any time on my hands due to assignments, so I figured I'd utilise the new forum! :smile: The rogue issue is when the following happens :- [spoiler=Large(ish) Image] That image was modified in Photoshop to try and show what's happening as a print-screen doesn't quite cut it. If you run the App you'll see what I mean. Oh, and the Red-Tip on the end of the missile corresponds to the stored Point2D location of the 'tip'. I'm comparing this to the mouse-location to check when to explode, rather than the Image (X,Y) coordinates as it would then try to collide with a point offset from the mouse cursor. It's a bit of a strange issue, I'm sure that with a bit of time and fiddling it's solvable, but at the moment I just don't have that! Provides something interesting for anyone to puzzle over too! :P I've uploaded the NetBeans Project folder as a 'zip' archive - easiest way I can think of providing it all in working condition, but if anyone knows a better way to do it feel free to say! :) Link: mediafire.com/?eujn0gm2qyw Alternatively, the relevant source code is here (Cheers sees_all!) :- [spoiler=Main] /* Fired every update. */ private void processMove() { //Determine the angle between the tip of the rocket and the mouse. theta = Methods.AngleBetweenPoints(new Point2D.Double(tipX, tipY), new Point2D.Double(mouseX, mouseY)); /* Determine the new point to move the image to based on the angle between the Tip of the rocket and the mouse location. * I assume this is throwing it off as it's pushing it too far past rather than recognising collision. */ Point2D.Double newPoint = Methods.GetNewAngle(4, theta, rocketX, rocketY); //Get a transform instance to get the new point of the rocket tip. AffineTransform at = AffineTransform.getRotateInstance(theta, rocket.getWidth() / 2, rocket.getHeight() / 2); Point2D newTipPoint = at.transform(new Point2D.Double(rTipX, rTipY), null); //Fix the angle. theta = Math.toRadians(Math.toDegrees(theta) + 90); rocketX = newPoint.x; rocketY = newPoint.y; tipX = newTipPoint.getX() + rocketX; tipY = newTipPoint.getY() + rocketY; } private void paintPanel(Graphics g) { ... if(!explosionVisible) { if(Methods.Distance(new Point2D.Double(tipX, tipY), new Point2D.Double(mouseX, mouseY)) < 5) { explosionVisible = true; } } ... } [spoiler=Methods] public static Double AngleBetweenPoints(Point2D.Double point1, Point2D.Double point2) { double xDistance = point2.x - point1.x; double yDistance = point2.y - point1.y; double theta = Math.atan2(yDistance, xDistance); return theta; } public static Point2D.Double GetNewAngle(double value, double theta, double x, double y) { double dx = xComponent(value, theta); double dy = yComponent(value, theta); return new Point2D.Double(x + dx, y + dy); } public static double xComponent(double value, double theta) { return value * Math.cos(theta); } public static double yComponent(double value, double theta) { return value * Math.sin(theta); } public static double Distance(Point2D.Double p1, Point2D.Double p2) { return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); } Any ideas and i'd be happy to hear them!
  10. Hmm, it's accessing Runescape but not getting access to the CSS? That's pretty odd...
  11. Hah, have to say I'd never heard of the 'sout(tab)' short-cut! That's got to come in handy! I'd have to agree with the laziness, I've learnt the basics of GUI-Building without a designer and can understand the core-concepts, but I'd have to seriously revise it if I was to design one without NetBeans. It's simply so much easier to use the Designer that it's one of those things you overlook. I'd have to view that as an advantage though - it certainly allows you to focus on the other parts of your program rather than spending so much more time making that GUI just perfect. ;) Love it! :smile:
  12. You're quite right, here's an excerpt from the Runescape Content Q&A found here: [Link]
  13. Much agreed! The Uni' is backing Eclipse as the IDE of choice for it's teachings but I can't stand it in comparison to Netbeans! There's something about the Eclipse GUI that I rather dislike...
  14. Haskell. :P More truthful terms - Java. I've tried quite a few languages but Java is the first that I've really stuck to. It's practical, largely cross-platform capable and has some fantastic documentation on the web. We did a bit of Haskell in the first semester of our course at University this year, but although a functional language is certainly interesting, it hardly compares in uses and ease with a language like Java, even though it has some great features like list comprehension! Thankfully - we're learning Java this second semster, albeit at a basic level! :^_^: Lately I have been looking at C#, but I'm finding it's quite a tricky language to get into, I certainly found that the documentation for example provided by Microsoft is nowhere near the simplicity that Java has, kinda threw me off the language. I'll probably take another look sometime soon though as perseverance is likely worthwhile!
  15. I've got the full-agility outfit on so my weight is less than 0 constantly. The problem lies in that with the pouch changes it's now very much possible to spend minimal time at the altar when crafting and very little time at the bank. (Due to MouseKeys and not-depositing Nature Runes). With the combination of the two, even with high-agility and a negative-weight outfit it's still possible to get down to 0 Energy as you are, almost, always running.
  16. Just chime in here and say that's not quite true! I've got 96 Agility and I find myself occassionally down to 0% Run Energy whilst Graahk-Runecrafting. Not quite sure on the Abyss though, presumably the stand-still at obstacles will give more time to regenerate energy than Graahking.
  17. Great first-99 and dedicated all the way, congratulations! :^_^:
  18. For anyone who's not willing to go to the Quick-Find link, here's the Mod's reply regarding the post on the Official Forums: Personally, I believe this is the right thing to do. Regardless of the fact that many jokes are thrown around in RuneScape, the possibility that it could save the life of a person who's serious about it outweighs that of not acting on it. Saying that though, perhaps it brings more light to the people who tend to joke about this kind of thing and make them reconsider how silly it is to do so. I'd assume it depends how they're getting the details, but if they are following up on IP Addresses there's numerous ways to backtrack from a Proxy to your IP-Address if you're using one. If your IP-Address has simply changed then it's still been assigned by your ISP to your location so can still be traced by your ISP if provided.
  19. This was the tracking for me, at Level 95 Agility and 88 Hunter for catching Sapphire Glacialis'. I know the timing's relatively short but it may give you an idea. Edit: I'll just add that I was focused throughout the timings, but it was just the first try at it so there may well be a possibility that the rates could increase once you get used to the method of hunting. Clicking the butterflies initially (certainly the polar ones!) can be quite tricky as they're so small!
  20. I'd support it too, could be very useful within time! :^_^:
  21. Sounds like an intriguing update. :^_^: Funny that they released it 'accidentally'. :P
  22. Nomad's got quite the ego to find his position on top of such a magnificent throne! ;) Congratulations on beating him!
  23. I'll get a trial of Excel and see if I can find out what's happening - could well be something that's different in Excel in comparison to OO Calc. :) Edit: Yea, it seems to be a difference in functionality between OpenOffice Calc and Excel unfortunately. I'll have a play around with it later if it's still needed. ;)
  24. Good call! ;) Added the two different versions now, as far as I'm aware - Excel uses commas rather than semi-colons. Someone may want to test that though. Thanks! :)
  25. I think the tricky part with compacting this is getting a reasonable formula for the Sigma notation of the Experience formula. As far as I'm aware, Excel doesn't have that great support for this. Doing a bit of searching though, I've managed a reasonable solution with OpenOffice Calc - I've not got Excel but you could certainly try it out and see if it works. (Little note: I've not played around with spreadsheets for quite sometime so the result is pretty ugly formulae - if anyone's got a better solution I'd love to see how it's done! :^_^:) Assume the cell containing the actual experience you have at the moment is CellA. Assume the cell containing the target level you desire is CellB. The formula I've used to calculate the needed experience to get to that target level is as follows: OpenOffice Calc Version: =ROUND((SUM((ROW(INDIRECT(("a1:a"&CellB-1)))/4) + (75 * 2^(ROW(INDIRECT(("a1:a"&CellB-1)))/7))))-CellA; 0) Microsoft Excel Version: =ROUND((SUM((ROW(INDIRECT(("a1:a"&CellB-1)))/4) + (75 * 2^(ROW(INDIRECT(("a1:a"&CellB-1)))/7))))-CellA, 0) You'll be replacing the occurrences of CellA and CellB with the actual references to the appropriate cells according to where they are on your spreadsheet. Note: It's not 100% accurate, as I've gone for the choice of using the Approximation formula from the link you gave, certainly initially it'll be less confusing to understand the formula needed. If desired, you could adapt it with the more accurate version to get more accuracy. Give it a try and let me know how it goes! ;) Edit: I always find images helpful, so here's what it looks like for me: Thanks 010jonathan for mentioning rounding! ;)

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.