﻿ What object is this cross in a circle?

• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 What object is this cross in a circle? Rinoldo PracticeBot Posts: 14 Threads: 3 Joined: Mar 2016 Reputation: 0 #6 03-18-2016, 02:52 PM (This post was last modified: 03-18-2016, 02:55 PM by Rinoldo.) (03-18-2016, 12:50 PM)tomaszkax86 Wrote: tar2.position is of type point, which has 3 floats. You need to save it to a variable and calculate position: You might want to use object's orientation (angle) to calculate position using cos() and sin(). I'v got some positive results, thanks! The idea to calculte position of an object is quite interesting. Could you explain with some example, please, how to get angle of an object using cos and sin? For example, Target2? (03-18-2016, 12:50 PM)tomaszkax86 Wrote: Side note: goto() is kinda like cheating. It's too easy. Try doing the same using motor() and jet(). I think this could be a good idea for a programming challenge. A speed run or something. Yes, I'm inclined to agree with you. But I confronted with some troubles using move(). In previous mission my WheeledShooter every time, when was stopped by a building or ruin or a bot, continued to do move() without end. Though there was errmode() in the code. In the same time, errmode() worked correctly when WheeledShooter confronted with some plant. Why in one case the game didn't take stopping as an error and in other case took it as an error and performed errmode() that is a big riddle for me. Here is that code: Code:```object ant, power; point pos, pos2; float lev = 0; ant=radar(AlienAnt); float dir = direction(ant.position); while(true) { while(radar(AlienAnt, 0, 360, 0, 20) == null) { ant = radar(AlienAnt); dir = direction(ant.position); turn(dir); errmode(0); int err; err = move(distance(position, ant.position)-40); if ( err != 0 ) { turn(90); move(3); } if (distance(position, ant.position) < 50) { ant = radar(AlienAnt); dir = direction(ant.position); turn(dir); aim(ant.position.z); fire(1); } if (energyCell.energyLevel < 0.5) break; } power = radar(PowerStation); goto(power.position); while(energyCell.energyLevel < 1) wait(1); } }``` « Next Oldest | Next Newest »

 Messages In This Thread What object is this cross in a circle? - by Rinoldo - 03-18-2016, 10:43 AM RE: What object is this cross in a circle? - by krzys_h - 03-18-2016, 11:04 AM RE: What object is this cross in a circle? - by Rinoldo - 03-18-2016, 11:34 AM RE: What object is this cross in a circle? - by tomaszkax86 - 03-18-2016, 12:50 PM RE: What object is this cross in a circle? - by Rinoldo - 03-18-2016, 02:52 PM RE: What object is this cross in a circle? - by krzys_h - 03-18-2016, 02:51 PM RE: What object is this cross in a circle? - by tomaszkax86 - 03-18-2016, 07:04 PM RE: What object is this cross in a circle? - by Rinoldo - 03-19-2016, 04:32 AM RE: What object is this cross in a circle? - by melex750 - 03-19-2016, 07:20 AM RE: What object is this cross in a circle? - by Rinoldo - 03-19-2016, 03:59 PM RE: What object is this cross in a circle? - by Simbax - 03-19-2016, 05:02 PM RE: What object is this cross in a circle? - by Rinoldo - 03-26-2016, 06:05 PM RE: What object is this cross in a circle? - by krzys_h - 03-26-2016, 06:25 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)