Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Kirl

Pages: 1 ... 3 4 5 6 7 8 9 [10] 11 12 13 14 15 16 17 ... 42
181
General chat / Re: Programming Codea on IPAD
« on: September 14, 2012 »
Can you explain what isn't looking smooth?

I'm not sure what your DY stands for, if it's like ball.vy you can multiply it by -1 to flip it's value from positive to negative and vice versa. In reality a bit of energy would be lost in the bounce so values between -1 and 0 would be better. (-0.8 or something)

My top bottom check looks like this:
Code: [Select]

if ball.y-ball.size/2 < 0 then -- if ball bottom is below lower screen
     ball.y = ball.size/2
     ball.vy = ball.vy * -1
elseif ball.y+ball.size/2 > HEIGHT then   -- use elseif to check either top or bottom colision
    ball.y = HEIGHT - ball.size/2             --  HEIGHT gives the screen height
     ball.vy = ball.vy * -1
end


182
General chat / Re: Ninendo WII U
« on: September 13, 2012 »
I'd love to see pikmin3, Scribblenauts Unlimited sounds interesting too. But those two aren't enough to sell me on the WiiU. I'll most likely be getting a PS4 at some point... It all depends on the games :)

I used to be a huge Nintendo fan, but they lost me somewhere around the Wii era...

183
General chat / Re: Programming Codea on IPAD
« on: September 13, 2012 »
There was an error in these lines:
Code: [Select]
ball.x = WIDTH/2 -- set x pos at center of screen
ball.y = HEIGHT/2 -- set y pos at center of screen
Make sure the second line reads "ball.y = ...etc" like it does now, instead of "ball.x = ..." as it said previously
Sorry for that, I'll fix it in the code above too. :)

184
General chat / Re: Programming Codea on IPAD
« on: September 13, 2012 »
If you start a new codea project there are two functions: setup() and draw(). The setup function is called once the program starts and the draw function is executed continuously every frame.

I'll try to put most of the explanations in the code as comments.

Code: [Select]
supportedOrientations(LANDSCAPE_LEFT) -- set orientation to horizontal (home button on the left screen)

-- called once at the start
function setup()
friction = .98  -- friction value to slow ball down over time

ball = {}       -- create ball object
ball.x = WIDTH/2 -- set x pos at center of screen
ball.y = HEIGHT/2 -- set y pos at center of screen
ball.vx = 0     -- value for ball x velocity
ball.vy = 0     -- value for ball y velocity
ball.size = 80
end

-- called every tick/frame
function draw()

background(0,0,0, 255) -- resets the background to clear the screen

-- apply basic physics
ball.vx = ball.vx + Gravity.x
ball.vy = ball.vy + Gravity.y
ball.vx = ball.vx * friction
ball.vy = ball.vy * friction

-- add velocities to the ball position
ball.x = ball.x + ball.vx
ball.y = ball.y + ball.vy 

doBound(ball)

ellipse(ball.x, ball.y, ball.size)  -- draw a circle at the location of the ball

end

-- function to collide ball with screen borders to keep it inside
function doBound(ball)

  if ball.y-ball.size/2 < 0 then -- if ball.y-radius is smaller then 0
     ball.y = ball.size/2           -- reset ball position at the border
     ball.vy = ball.vy * -1       -- reverse y velocity
  end

   -- there's only a check for one side of the screen boundary in here, try to figure the logic for the other 3 walls!   
end


I typed this up in the forum text editor, so there might be some minor errors in there I overlooked and sorry for the lack of formatting. If you need help with the other 3 screen boundaries or want some explanations let me know.

Once you got this up and running I got some interesting but very simple little additions to experiment with, like generated sounds etc. :)

185
General chat / Re: The Welcoming Committee
« on: September 11, 2012 »
Hello Liso!  :hi:

186
Challenges & Competitions / Re: [CUBES] Flip Flop Cubes
« on: September 10, 2012 »
Unexpected red text was an instant classic!  ;D

187
General chat / Re: Programming Codea on IPAD
« on: September 07, 2012 »
After a few obligatory evenings of confusement, I've come to like Lua. I'm missing some functionality, but there's a lot of interesting new stuff to play with too.

I really dig the Cargo Bot example game, it's the perfect kind of thing to include in a programmers toy. Very tough and interesting logic puzzles!

188
General chat / Re: Programming Codea on IPAD
« on: September 06, 2012 »
 :goodpost:

Having a ball with codea, thanks for posting Hotshot!

The typing isn't nearly as uncomfortable as I feared. It's good fun playing around with the accelerometers and sound generation, I'm trying to port my locoroco soft bodies to lua, hunting down some strange error atm...

189
Other languages / Re: using arrays/tables in Lua?
« on: September 03, 2012 »
Thanks I'm having trouble storing a double value (x and y) per array item in particular. The next page about multi dimensional arrays may offer a solution, thanks for the link! :)

190
Other languages / using arrays/tables in Lua?
« on: September 03, 2012 »
Anybody got any experience with Lua?

I'm playing around with the coding app codea (or codify) for ipad and I'm having some trouble filling an array/table with xy values and retrieving them.

191
General chat / Re: Happy Birthday Jace!
« on: August 29, 2012 »
Happy Birthday buddy!  :cheers:

192
General chat / Re: iOS demos. Hello world...
« on: August 28, 2012 »
 :hi: Flexiverse!

Hope you do make some IOS demo stuff. I'm a lot of people would really love it.
Me too, I'd love it. It may very well be the first cool thing I see on the ipad ever! :)

193
General chat / Re: Hi all
« on: August 28, 2012 »
Welcome adam301173, some interesting projects you mentioned, looking forward to see some remakes from you. Hopefully there'll be another challenge soon, they're great for some free form programming practice!

 :hi:

194
... Have you pre-ordered one?

Nah, I would love to play around with it, but there's still loads of interesting input devices I haven't gotten around to experiment with. I wonder how much of an impact this will make when it's being shipped.

@blacksheep
I love the orchestral treatment of game music, beautiful! :)

196
Social and marital status, sexual preferences, internet shopping and search history, reading habits and interests... :protest:

<a href="http://www.youtube.com/watch?v=1U8KsQPIrY0" target="_blank">http://www.youtube.com/watch?v=1U8KsQPIrY0</a>

197
General chat / Re: New Computer for General 2
« on: August 21, 2012 »
They can design clever ways of matching up newbies with newbies. That said, I can't stand the multiplayer obsession. It's what happens when they only look at the numbers and stop thinking about anthing else.

Going multiplayer only makes total financial sense, but we don't play games for the money...  :-\

198
Projects / Re: Space Cube Intro
« on: August 15, 2012 »
Cool demo, I enjoyed it and got me thinking of trying a 3d dot cube too!  :clap:
Thanks for the greets!

Hope you get well soon!

199
General chat / Re: The Welcoming Committee
« on: August 07, 2012 »
Hello Tronix, some really cool stuff on show there!  :clap:
Is that a GPS at the bottom with the fire?

Welcome to the boards!

200
I feel Facebook destroys the romance and power of the anonymous old web...  :'(

Their questionable tactics and software to gain insight into you and your social life scares me. Groups with an interest in that kind of data are having a field day!

Pages: 1 ... 3 4 5 6 7 8 9 [10] 11 12 13 14 15 16 17 ... 42