Need help on 3 functionality question I have about Corona

I still don’t know everything Corona IS or is NOT capable of. I have 3 questions about 2 ideas I want to implement. Hoping the awesome people on here can provide me with some help.

  1. Thinking along the line of a simple 2D game that would have Cross Hairs (of a gun) from a first person standpoint (while looking at a 2D world, is it possible to “shoot” things? So the bullet would not be going from left to right. Or even visible at all. The scope might need to “sway” back and forth a bit then have a button on the screen to “fire” with the ability to hit a target on the screen that is in the cross hairs.

Wondering if this is possible

  1. In the hopes of making an app which we will use an easy example of say a yelp. An app in which I can give people a web form on a pc to fill in data. Possibly with a user name login/password etc in which the users with the app can search through that data and pull it up.

Wondering if this is possible? I have seen some info on JSON and MYSQL but I am a newbie and am looking to see if this is possible and if so what the best route may be.

  1. Are there any basic 3D engines that you can integrate into Corona?
    Thank you for any help! You will hopefully all get copies of my apps if I can ever complete them! [import]uid: 195976 topic_id: 34042 reply_id: 334042[/import]
  1. Yes this is most doable.

  2. Yes, quite very doable. You will use network.request() to fetch some data from your server (JSON is preferable, but you can use XML). Then you can use things like widgets.newTableView() to display your results.

I wrote a blog post on this subject that you might find helpful:
http://omnigeek.robmiracle.com/2012/04/15/using-corona-sdk-with-rest-api-services/

  1. Not with the regular Corona SDK (Pro or Indie). Corona Enterprise could potentially link to other 3D engines, but at that point, I’m not sure how Corona is going to contribute to the project since the 3D engine basically drives the whole app.

[import]uid: 199310 topic_id: 34042 reply_id: 135381[/import]

thanks for your reply man! I will forget question 3 for now. Question 2 I will read your blog post and hopefully find my way through it. Question 1 I feel like should not be that difficult but I am having a hard time picturing how to do it based on the video Corona course I have been learning from.

I am trying to figure out how I would get say cross hairs in the middle of the screen to be moved by say a “joystick” in the bottom left of the screen and a “fire” button in the bottom right of the screen. Where pressing the fire button “kills” what ever is in the middle of the cross hairs set in the center of the screen.

thanks again for any help!

Patrick [import]uid: 195976 topic_id: 34042 reply_id: 135384[/import]

Well #1 is really pretty simple, but it does take a bit of work.

You will need your cross hair graphic, a PNG with transparency so you can see through it. Draw it on screen with the display.newImageRect() API Call.

Next you will need to code up a joystick. I don’t recommend that you tackle this on your own but find one in the community code. It will have hooks to move a player (your site) around the screen. The folks who do Particle Candy produced a Joystick module that quite a few people use.

Coding up a Fire button is pretty easy to do.

Then you put your targets on screen.

When you press your fire button, it will trigger an event handler function that you write and in that function, you can do a simple collision check to see if your site and your target are occupying the same space. See my blog post on this subject:

http://omnigeek.robmiracle.com/2011/12/14/collision-detection-without-physics/

I would recommend using the circular method since you can set the distance between the two circles (site and target) based on difficulty. Make the distance for a small target or if you’re doing a kids game and want to be “close enough” then you can use a larger distance.

If that hasCollidedCircle() function returns true, you hit, and then you can remove your object, increment your score, etc.
[import]uid: 199310 topic_id: 34042 reply_id: 135386[/import]

awesome man. this is the best!
im going to get to work on this [import]uid: 195976 topic_id: 34042 reply_id: 135391[/import]

  1. Yes this is most doable.

  2. Yes, quite very doable. You will use network.request() to fetch some data from your server (JSON is preferable, but you can use XML). Then you can use things like widgets.newTableView() to display your results.

I wrote a blog post on this subject that you might find helpful:
http://omnigeek.robmiracle.com/2012/04/15/using-corona-sdk-with-rest-api-services/

  1. Not with the regular Corona SDK (Pro or Indie). Corona Enterprise could potentially link to other 3D engines, but at that point, I’m not sure how Corona is going to contribute to the project since the 3D engine basically drives the whole app.

[import]uid: 199310 topic_id: 34042 reply_id: 135381[/import]

thanks for your reply man! I will forget question 3 for now. Question 2 I will read your blog post and hopefully find my way through it. Question 1 I feel like should not be that difficult but I am having a hard time picturing how to do it based on the video Corona course I have been learning from.

I am trying to figure out how I would get say cross hairs in the middle of the screen to be moved by say a “joystick” in the bottom left of the screen and a “fire” button in the bottom right of the screen. Where pressing the fire button “kills” what ever is in the middle of the cross hairs set in the center of the screen.

thanks again for any help!

Patrick [import]uid: 195976 topic_id: 34042 reply_id: 135384[/import]

Well #1 is really pretty simple, but it does take a bit of work.

You will need your cross hair graphic, a PNG with transparency so you can see through it. Draw it on screen with the display.newImageRect() API Call.

Next you will need to code up a joystick. I don’t recommend that you tackle this on your own but find one in the community code. It will have hooks to move a player (your site) around the screen. The folks who do Particle Candy produced a Joystick module that quite a few people use.

Coding up a Fire button is pretty easy to do.

Then you put your targets on screen.

When you press your fire button, it will trigger an event handler function that you write and in that function, you can do a simple collision check to see if your site and your target are occupying the same space. See my blog post on this subject:

http://omnigeek.robmiracle.com/2011/12/14/collision-detection-without-physics/

I would recommend using the circular method since you can set the distance between the two circles (site and target) based on difficulty. Make the distance for a small target or if you’re doing a kids game and want to be “close enough” then you can use a larger distance.

If that hasCollidedCircle() function returns true, you hit, and then you can remove your object, increment your score, etc.
[import]uid: 199310 topic_id: 34042 reply_id: 135386[/import]

awesome man. this is the best!
im going to get to work on this [import]uid: 195976 topic_id: 34042 reply_id: 135391[/import]